Class PropertyMetadata


  • public class PropertyMetadata
    extends Object
    Metadata for a Property.
    Since:
    2022-09-01
    Author:
    miki
    • Constructor Detail

      • PropertyMetadata

        public PropertyMetadata​(String name,
                                Class<V> valueType,
                                V value)
        Constructs a PropertyMetadata.
        Type Parameters:
        V - Type of value.
        Parameters:
        name - Name of the metadata.
        valueType - Type of value of the metadata.
        value - Value of the metadata.
    • Method Detail

      • getName

        public String getName()
        Returns the name of the metadata.
        Returns:
        Name of the metadata.
      • getValueType

        public Class<?> getValueType()
        Returns the type of value of the metadata.
        Returns:
        Type of value.
      • getValue

        public Object getValue()
        Returns the value of the metadata. It is of the type returned by getValueType().
        Returns:
        Value of the metadata. Can be null.
      • hasValueOfType

        public boolean hasValueOfType​(Class<?> type)
        Checks if the value of the metadata is an instance of the given type.
        Parameters:
        type - Type to check.
        Returns:
        Same as type.isInstance(this.getValue)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object