Class DefaultAttributeBuilder

    • Field Detail

      • attributes

        protected final java.util.List<Attribute> attributes
      • name2Attribute

        protected final java.util.Map<java.lang.String,​Attribute> name2Attribute
    • Constructor Detail

      • DefaultAttributeBuilder

        public DefaultAttributeBuilder()
    • Method Detail

      • createAttribute

        public <T> Attribute<T> createAttribute​(java.lang.String name)
        Create Attribute with name
        Specified by:
        createAttribute in interface AttributeBuilder
        Type Parameters:
        T - Type of attribute value
        Parameters:
        name - attribute name
        Returns:
        Attribute
      • createAttribute

        public <T> Attribute<T> createAttribute​(java.lang.String name,
                                                T defaultValue)
        Create Attribute with name and default value
        Specified by:
        createAttribute in interface AttributeBuilder
        Type Parameters:
        T - Type of attribute value
        Parameters:
        name - attribute name
        defaultValue - attribute's default value
        Returns:
        Attribute
      • createAttribute

        public <T> Attribute<T> createAttribute​(java.lang.String name,
                                                java.util.function.Supplier<T> initializer)
        Create Attribute with name and initializer, which will be called, if Attribute's value is null on a AttributedObject
        Specified by:
        createAttribute in interface AttributeBuilder
        Type Parameters:
        T - Type of attribute value
        Parameters:
        name - attribute name
        initializer - Supplier, which will be called, if Attribute's value is null on a AttributedObject
        Returns:
        Attribute
      • getAttributeByName

        protected Attribute getAttributeByName​(java.lang.String name)
      • getAttributeByIndex

        protected Attribute getAttributeByIndex​(int index)