Home / Class/ Builder Class — netty Architecture

Builder Class — netty Architecture

Architecture documentation for the Builder class in WebSocketDecoderConfig.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c46421cb_62de_978f_ec36_13e93201590b["Builder"]
  3579b8fc_7122_d5ba_f1c1_9e8b0ec42998["WebSocketDecoderConfig.java"]
  c46421cb_62de_978f_ec36_13e93201590b -->|defined in| 3579b8fc_7122_d5ba_f1c1_9e8b0ec42998
  de2920c6_bcf7_9063_7425_b64cc7c11bff["Builder()"]
  c46421cb_62de_978f_ec36_13e93201590b -->|method| de2920c6_bcf7_9063_7425_b64cc7c11bff
  76bc8139_db65_413b_0ac9_d98bd5d8830e["WebSocketDecoderConfig()"]
  c46421cb_62de_978f_ec36_13e93201590b -->|method| 76bc8139_db65_413b_0ac9_d98bd5d8830e

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketDecoderConfig.java lines 111–164

    public static final class Builder {
        private int maxFramePayloadLength;
        private boolean expectMaskedFrames;
        private boolean allowMaskMismatch;
        private boolean allowExtensions;
        private boolean closeOnProtocolViolation;
        private boolean withUTF8Validator;

        private Builder(WebSocketDecoderConfig decoderConfig) {
            ObjectUtil.checkNotNull(decoderConfig, "decoderConfig");
            maxFramePayloadLength = decoderConfig.maxFramePayloadLength();
            expectMaskedFrames = decoderConfig.expectMaskedFrames();
            allowMaskMismatch = decoderConfig.allowMaskMismatch();
            allowExtensions = decoderConfig.allowExtensions();
            closeOnProtocolViolation = decoderConfig.closeOnProtocolViolation();
            withUTF8Validator = decoderConfig.withUTF8Validator();
        }

        public Builder maxFramePayloadLength(int maxFramePayloadLength) {
            this.maxFramePayloadLength = maxFramePayloadLength;
            return this;
        }

        public Builder expectMaskedFrames(boolean expectMaskedFrames) {
            this.expectMaskedFrames = expectMaskedFrames;
            return this;
        }

        public Builder allowMaskMismatch(boolean allowMaskMismatch) {
            this.allowMaskMismatch = allowMaskMismatch;
            return this;
        }

        public Builder allowExtensions(boolean allowExtensions) {
            this.allowExtensions = allowExtensions;
            return this;
        }

        public Builder closeOnProtocolViolation(boolean closeOnProtocolViolation) {
            this.closeOnProtocolViolation = closeOnProtocolViolation;
            return this;
        }

        public Builder withUTF8Validator(boolean withUTF8Validator) {
            this.withUTF8Validator = withUTF8Validator;
            return this;
        }

        public WebSocketDecoderConfig build() {
            return new WebSocketDecoderConfig(
                    maxFramePayloadLength, expectMaskedFrames, allowMaskMismatch,
                    allowExtensions, closeOnProtocolViolation, withUTF8Validator);
        }
    }

Frequently Asked Questions

What is the Builder class?
Builder is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketDecoderConfig.java.
Where is Builder defined?
Builder is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketDecoderConfig.java at line 111.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free