Class TypeImpl

  • All Implemented Interfaces:
    Type

    public class TypeImpl
    extends java.lang.Object
    implements Type
    • Field Detail

      • name

        private final java.lang.String name
      • instances

        private final java.util.Map<java.lang.String,​Instance> instances
      • metadata

        private java.lang.Object metadata
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: Type
        A unique identifier for this type
        Specified by:
        getName in interface Type
        Returns:
        A unique identifier for this type (may not return null)
      • getInstances

        public java.util.Map<java.lang.String,​Instance> getInstances()
        Description copied from interface: Type
        Returns a read-only map of the instances that are associated with this type
        Specified by:
        getInstances in interface Type
        Returns:
        A read-only and possibly empty map of instances associated with this type
      • getInstance

        public Instance getInstance​(java.lang.String key)
        Description copied from interface: Type
        Gets the instance associated with this key, or null if there is none
        Specified by:
        getInstance in interface Type
        Parameters:
        key - The non-null key for the instance
        Returns:
        The resulting instance or null if there is none
      • getMetadata

        public java.lang.Object getMetadata()
        Description copied from interface: Type
        Gets information about this type. Can be used to describe the type in some useful way
        Specified by:
        getMetadata in interface Type
        Returns:
        The possibly null metadata associated with this type
      • setMetadata

        public void setMetadata​(java.lang.Object metadata)
        Description copied from interface: Type
        Sets an object containing information about this type. Can be used to describe the type in some useful way
        Specified by:
        setMetadata in interface Type
        Parameters:
        metadata - The possibly null metadata to be associated with this type
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object