Interface PropertyMetadata<V>

    • Method Detail

      • getExpression

        Supplier<? extends V> getExpression()
        Returns:
        the optional Supplier that calculates the value dynamically. May be null for a regular property. If it is not null the property will automatically be read-only. You should not provide an explicit validator if you provide an expression.
      • get

        Object get​(String key)
        Parameters:
        key - the key of the requested metadata.
        Returns:
        the value of the metadata for the given key. Will be null if no metadata exists for the given key.
        See Also:
        get(String, Class)
      • get

        default <T> T get​(String key,
                          Class<T> type)
        Type Parameters:
        T - type of the metadata.
        Parameters:
        key - the key of the requested metadata.
        type - Class reflecting the type of the requested metadata value.
        Returns:
        the value of the metadata for the given key. Will be null if no metadata exists for the given key.
      • get

        default <T> T get​(Class<T> type)
        ATTENTION: This is a convenient method for get(String, Class) where Class.getName() is used as key. Be aware that this can only work for final classes, Annotations or if the producer of this PropertyMetadata provides the metadata under the type you are expecting as API. Also it is discouraged to use this method for generic types such as String or Long as values of such type can be anything and should have a semantic key.
        Type Parameters:
        T - type of the metadata.
        Parameters:
        type - Class reflecting the type of the requested metadata value.
        Returns:
        the value of the metadata for the given key. Will be null if no metadata exists for the given key.
        See Also:
        get(String, Class)
      • getKeyCount

        int getKeyCount()
        Returns:
        the size of the key/ value pairs in this map.
      • hasKeys

        default boolean hasKeys()
        Returns:
        true if this metadata has at least one key/value pair, false otherwise (if empty and key count is 0).
      • getMarshalling

        default Marshalling<V> getMarshalling()
        Returns:
        the optional custom Marshalling. If null the default marshalling of the Property is used. Overriding also allows to extend or replace the property value with more complex data from this metadata - e.g. to reuse a Bean to represent a query to find instances of that Bean.
      • isTransient

        default boolean isTransient()
        Returns:
        true if transient (e.g. computed and therefore not to be marshalled), false otherwise.
        See Also:
        ReadableProperty.isTransient()