Class AttributeDefinition<T>

  • public final class AttributeDefinition<T>
    extends java.lang.Object
    AttributeDefinition. Defines the characteristics of a configuration attribute. It is used to construct an actual Attribute holder. An attribute definition has the following characteristics:
    • A name
    • A default value or a value initializer
    • A type, which needs to be specified if it cannot be inferred from the default value, i.e. when it is null
    • Whether an attribute is immutable or not, i.e. whether its value is constant after initialization or it can be changed
    • A validator which intercepts invalid values
    Tristan Tarrant
    • Method Detail

      • name

        public java.lang.String name()
      • xmlName

        public java.lang.String xmlName()
      • getType

        public java.lang.Class<T> getType()
      • getDefaultValue

        public T getDefaultValue()
      • isImmutable

        public boolean isImmutable()
      • isAutoPersist

        public boolean isAutoPersist()
      • isGlobal

        public boolean isGlobal()
      • validate

        public void validate​(T value)
      • builder

        public static <T> AttributeDefinition.Builder<T> builder​(java.lang.String name,
                                                                 T defaultValue,
                                                                 java.lang.Class<T> klass)
      • classBuilder

        public static <T> AttributeDefinition.Builder<java.lang.Class<? extends T>> classBuilder​(java.lang.String name,
                                                                                                 java.lang.Class<T> klass)
      • supplierBuilder

        public static <T> AttributeDefinition.Builder<java.util.function.Supplier<? extends T>> supplierBuilder​(java.lang.String name,
                                                                                                                java.lang.Class<T> klass)
      • equals

        public boolean equals​(java.lang.Object o)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object