Class AttributeMap

    • Constructor Detail

      • AttributeMap

        public AttributeMap()
        Instantiates a new Attribute map.
    • Method Detail

      • get

        public <T> T get​(@NonNull
                         @NonNull AttributeType<T> attributeType)
        Gets the value of the given attribute
        Type Parameters:
        T - the type of the attribute
        Parameters:
        attributeType - the attribute type
        Returns:
        the value of the attribute
      • getOrDefault

        public <T> T getOrDefault​(@NonNull
                                  @NonNull AttributeType<T> attributeType,
                                  T defaultValue)
        Gets the value of the given attribute or returns the default value if it is not in the map
        Type Parameters:
        T - the type of the attribute
        Parameters:
        attributeType - the attribute type
        defaultValue - the default value
        Returns:
        the value of the attribute or the default value if the attribute is not in the map