Interface NodeMetadataKey<T>

Type Parameters:
T - the metadata type

@NonExtendable public interface NodeMetadataKey<T>
Represents a key for a specific type of node metadata.

It is intended that NodeMetadataKeys are obtained and stored as follows.

     public static final NodeMetadataKey<SpecialMetadata> SPECIAL_METADATA_KEY = NodeMetadataKey.of("specialmetadata", SpecialMetadata.class);
 
  • Method Details

    • of

      static <T> @NonNull NodeMetadataKey<T> of(@NonNull String name, @NonNull Class<T> type)
      Creates a new NodeMetadataKey for the given name and type.

      Note that the returned key implements object reference equality.

      Type Parameters:
      T - the type parameter
      Parameters:
      name - the name
      type - the type
      Returns:
      the key
    • name

      Gets a name describing the key type.
      Returns:
      the key name
    • type

      @NonNull Class<T> type()
      Gets the type of the key
      Returns:
      the type