Home / Function/ add() — netty Function Reference

add() — netty Function Reference

Architecture documentation for the add() function in MqttProperties.java from the netty codebase.

Function java Buffer Allocators calls 2 called by 3

Entity Profile

Dependency Diagram

graph TD
  1884d271_a8c7_8143_e8ee_2f6e4070b19d["add()"]
  b94e5449_132b_7007_b936_295b901f2ffe["MqttProperties"]
  1884d271_a8c7_8143_e8ee_2f6e4070b19d -->|defined in| b94e5449_132b_7007_b936_295b901f2ffe
  19809981_1e50_2fe2_4c0d_bac116bd116a["add()"]
  19809981_1e50_2fe2_4c0d_bac116bd116a -->|calls| 1884d271_a8c7_8143_e8ee_2f6e4070b19d
  045e60ec_eeba_f5c7_543e_20346d4765d8["listAll()"]
  045e60ec_eeba_f5c7_543e_20346d4765d8 -->|calls| 1884d271_a8c7_8143_e8ee_2f6e4070b19d
  0abc27f1_a211_9167_53c8_e86bb18d9b01["UserProperties()"]
  0abc27f1_a211_9167_53c8_e86bb18d9b01 -->|calls| 1884d271_a8c7_8143_e8ee_2f6e4070b19d
  19809981_1e50_2fe2_4c0d_bac116bd116a["add()"]
  1884d271_a8c7_8143_e8ee_2f6e4070b19d -->|calls| 19809981_1e50_2fe2_4c0d_bac116bd116a
  549facbe_e04c_c008_8b4f_d7749831caa7["UserProperty()"]
  1884d271_a8c7_8143_e8ee_2f6e4070b19d -->|calls| 549facbe_e04c_c008_8b4f_d7749831caa7
  style 1884d271_a8c7_8143_e8ee_2f6e4070b19d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java lines 338–376

    public void add(MqttProperty property) {
        if (!canModify) {
            throw new UnsupportedOperationException("adding property isn't allowed");
        }
        IntObjectHashMap<MqttProperty> props = this.props;
        if (property.propertyId == USER_PROPERTY) {
            List<UserProperty> userProperties = this.userProperties;
            if (userProperties == null) {
                userProperties = new ArrayList<>(1);
                this.userProperties = userProperties;
            }
            if (property instanceof UserProperty) {
                userProperties.add((UserProperty) property);
            } else if (property instanceof UserProperties) {
                for (StringPair pair: ((UserProperties) property).value) {
                    userProperties.add(new UserProperty(pair.key, pair.value));
                }
            } else {
                throw new IllegalArgumentException("User property must be of UserProperty or UserProperties type");
            }
        } else if (property.propertyId == SUBSCRIPTION_IDENTIFIER) {
            List<IntegerProperty> subscriptionIds = this.subscriptionIds;
            if (subscriptionIds == null) {
                subscriptionIds = new ArrayList<>(1);
                this.subscriptionIds = subscriptionIds;
            }
            if (property instanceof IntegerProperty) {
                subscriptionIds.add((IntegerProperty) property);
            } else {
                throw new IllegalArgumentException("Subscription ID must be an integer property");
            }
        } else {
            if (props == null) {
                props = new IntObjectHashMap<MqttProperty>();
                this.props = props;
            }
            props.put(property.propertyId, property);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does add() do?
add() is a function in the netty codebase, defined in codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java.
Where is add() defined?
add() is defined in codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java at line 338.
What does add() call?
add() calls 2 function(s): UserProperty, add.
What calls add()?
add() is called by 3 function(s): UserProperties, add, listAll.

Analyze Your Own Codebase

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

Try Supermodel Free