- 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()
Object
get(String key)
Supplier<? extends V>
getExpression()
int
getKeyCount()
Iterable<String>
getKeys()
Validator<? super V>
getValidator()
Type
getValueType()
-
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:
getValidator
in interfacePropertyMetadata<V>
- Returns:
- the
Validator
used tovalidate
the property.
-
getExpression
public Supplier<? extends V> getExpression()
- Specified by:
getExpression
in interfacePropertyMetadata<V>
- Returns:
- the optional
Supplier
that calculates thevalue
dynamically. May benull
for a regular property. If it is notnull
the property will automatically beread-only
. You should not provide an explicitvalidator
if you provide an expression.
-
getValueType
public Type getValueType()
- Specified by:
getValueType
in interfacePropertyMetadata<V>
- Returns:
- the optional
Type
of theproperty value
. May benull
. - See Also:
ReadableTypedValue.getValueClass()
-
get
public Object get(String key)
- Specified by:
get
in interfacePropertyMetadata<V>
- Parameters:
key
- thekey
of the requested metadata.- Returns:
- the value of the metadata for the given
key
. Will benull
if no metadata exists for the givenkey
. - See Also:
PropertyMetadata.get(String, Class)
-
getKeys
public Iterable<String> getKeys()
- Specified by:
getKeys
in interfacePropertyMetadata<V>
- Returns:
- the
Iterable
of allmetadata keys
.
-
getKeyCount
public int getKeyCount()
- Specified by:
getKeyCount
in interfacePropertyMetadata<V>
- Returns:
- the
size
of thekey
/value
pairs in this map.
-
-