Class Attribute<T>

    • Field Detail

      • name

        private final java.lang.String name
      • description

        private final java.lang.String description
    • Constructor Detail

      • Attribute

        protected Attribute​(java.lang.String identifier,
                            java.lang.String name,
                            java.lang.String description,
                            ContentType<T> contentType)
        Protected constructor. Use one of the parameterized factory methods instead.
        Parameters:
        identifier - attribute id
        name - attribute name
        description - attribute description
        contentType - content type of the attribute values
        See Also:
        attr(String, String, String, ContentType), attr(String, String, ContentType)
    • Method Detail

      • attr

        public static final <T> IAttribute<T> attr​(java.lang.String identifier,
                                                   java.lang.String name,
                                                   java.lang.String description,
                                                   ContentType<T> contentType)
        Obtain an attribute.
        Type Parameters:
        T - attribute value type
        Parameters:
        identifier - attribute id
        name - attribute name
        description - attribute description
        contentType - content type of the attribute values
        Returns:
        an attribute
      • attr

        public static final <T> IAttribute<T> attr​(java.lang.String identifier,
                                                   java.lang.String name,
                                                   ContentType<T> contentType)
        Obtain an attribute.
        Type Parameters:
        T - attribute value type
        Parameters:
        identifier - attribute id
        name - attribute name
        contentType - content type of the attribute values
        Returns:
        an attribute
      • getCanonical

        private static <T> ICanonicalAccessorFactory<T> getCanonical​(CanonicalAccessorFactory<T> key)
        If the attribute key has a canonical equivalent, get that. Otherwise, use key.
        Parameters:
        key -
        Returns:
        key or a canonical equivalent
      • getCanonical

        private static <T> IAttribute<T> getCanonical​(Attribute<T> key)
        If the attribute key has a canonical equivalent, get that. Otherwise, use key.
        Parameters:
        key -
        Returns:
        key or a canonical equivalent
      • canonicalize

        public static <T> IAttribute<T> canonicalize​(Attribute<T> key)
        Set key as the canonical (and only allowed) attribute for its equivalence class.
        Type Parameters:
        T - attribute value type
        Parameters:
        key - attribute to canonicalize
        Returns:
        canonicalized attribute
        Throws:
        java.lang.IllegalStateException - if an equivalent attribute has already been canonicalized
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface IDescribable
        Returns:
        the name of this object
      • getDescription

        public java.lang.String getDescription()
        Specified by:
        getDescription in interface IDescribable
        Returns:
        the description of this object