- java.lang.Object
-
- io.github.mmm.property.AbstractPropertyMetadata<V>
-
- Type Parameters:
V- type of theproperty value.
- All Implemented Interfaces:
PropertyMetadata<V>
- Direct Known Subclasses:
BeanPropertyMetadataSimple,PropertyMetadataNone,PropertyMetadataType
public abstract class AbstractPropertyMetadata<V> extends Object implements PropertyMetadata<V>
Abstract base implementation ofPropertyMetadata.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AbstractPropertyMetadata()The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>asMap()Objectget(String key)Supplier<? extends V>getExpression()intgetKeyCount()Iterable<String>getKeys()Validator<? super V>getValidator()TypegetValueType()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.property.PropertyMetadata
get, get, getMarshalling, hasKeys, isTransient, withValidator
-
-
-
-
Method Detail
-
getValidator
public Validator<? super V> getValidator()
- Specified by:
getValidatorin interfacePropertyMetadata<V>- Returns:
- the
Validatorused tovalidatethe property.
-
getExpression
public Supplier<? extends V> getExpression()
- Specified by:
getExpressionin interfacePropertyMetadata<V>- Returns:
- the optional
Supplierthat calculates thevaluedynamically. May benullfor a regular property. If it is notnullthe property will automatically beread-only. You should not provide an explicitvalidatorif you provide an expression.
-
getValueType
public Type getValueType()
- Specified by:
getValueTypein interfacePropertyMetadata<V>- Returns:
- the optional
Typeof theproperty value. May benull. - See Also:
ReadableTypedValue.getValueClass()
-
get
public Object get(String key)
- Specified by:
getin interfacePropertyMetadata<V>- Parameters:
key- thekeyof the requested metadata.- Returns:
- the value of the metadata for the given
key. Will benullif no metadata exists for the givenkey. - See Also:
PropertyMetadata.get(String, Class)
-
getKeys
public Iterable<String> getKeys()
- Specified by:
getKeysin interfacePropertyMetadata<V>- Returns:
- the
Iterableof allmetadata keys.
-
getKeyCount
public int getKeyCount()
- Specified by:
getKeyCountin interfacePropertyMetadata<V>- Returns:
- the
sizeof thekey/valuepairs in this map.
-
-