Home / Class/ AttributeKey Class — netty Architecture

AttributeKey Class — netty Architecture

Architecture documentation for the AttributeKey class in AttributeKey.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b1f09389_7211_259a_8e8f_9c1a78f534f8["AttributeKey"]
  853c1c9d_7365_95a4_e7f6_866d2a6d88e4["AttributeKey.java"]
  b1f09389_7211_259a_8e8f_9c1a78f534f8 -->|defined in| 853c1c9d_7365_95a4_e7f6_866d2a6d88e4
  37d3dfff_9724_0604_3949_db4cfe7dec99["valueOf()"]
  b1f09389_7211_259a_8e8f_9c1a78f534f8 -->|method| 37d3dfff_9724_0604_3949_db4cfe7dec99
  04ce6b77_1ab8_1f28_8b5c_9719c8a261bc["exists()"]
  b1f09389_7211_259a_8e8f_9c1a78f534f8 -->|method| 04ce6b77_1ab8_1f28_8b5c_9719c8a261bc
  f6abe58c_f080_1cd9_36a0_f1dc1d83fa9f["newInstance()"]
  b1f09389_7211_259a_8e8f_9c1a78f534f8 -->|method| f6abe58c_f080_1cd9_36a0_f1dc1d83fa9f
  1ced903d_27cc_6119_4e5c_6e40b152042a["AttributeKey()"]
  b1f09389_7211_259a_8e8f_9c1a78f534f8 -->|method| 1ced903d_27cc_6119_4e5c_6e40b152042a

Relationship Graph

Source Code

common/src/main/java/io/netty/util/AttributeKey.java lines 24–66

@SuppressWarnings("UnusedDeclaration") // 'T' is used only at compile time
public final class AttributeKey<T> extends AbstractConstant<AttributeKey<T>> {

    private static final ConstantPool<AttributeKey<Object>> pool = new ConstantPool<AttributeKey<Object>>() {
        @Override
        protected AttributeKey<Object> newConstant(int id, String name) {
            return new AttributeKey<Object>(id, name);
        }
    };

    /**
     * Returns the singleton instance of the {@link AttributeKey} which has the specified {@code name}.
     */
    @SuppressWarnings("unchecked")
    public static <T> AttributeKey<T> valueOf(String name) {
        return (AttributeKey<T>) pool.valueOf(name);
    }

    /**
     * Returns {@code true} if a {@link AttributeKey} exists for the given {@code name}.
     */
    public static boolean exists(String name) {
        return pool.exists(name);
    }

    /**
     * Creates a new {@link AttributeKey} for the given {@code name} or fail with an
     * {@link IllegalArgumentException} if a {@link AttributeKey} for the given {@code name} exists.
     */
    @SuppressWarnings("unchecked")
    public static <T> AttributeKey<T> newInstance(String name) {
        return (AttributeKey<T>) pool.newInstance(name);
    }

    @SuppressWarnings("unchecked")
    public static <T> AttributeKey<T> valueOf(Class<?> firstNameComponent, String secondNameComponent) {
        return (AttributeKey<T>) pool.valueOf(firstNameComponent, secondNameComponent);
    }

    private AttributeKey(int id, String name) {
        super(id, name);
    }
}

Frequently Asked Questions

What is the AttributeKey class?
AttributeKey is a class in the netty codebase, defined in common/src/main/java/io/netty/util/AttributeKey.java.
Where is AttributeKey defined?
AttributeKey is defined in common/src/main/java/io/netty/util/AttributeKey.java at line 24.

Analyze Your Own Codebase

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

Try Supermodel Free