Module io.github.mmm.property
Package io.github.mmm.property.factory
Interface PropertyFactory<V,P extends WritableProperty<V>>
-
- Type Parameters:
V- the generic type of theproperty value.P- the generic type of theproperty implementation.
- All Known Implementing Classes:
AbstractPropertyFactory,PropertyFactoryBean,PropertyFactoryBigDecimal,PropertyFactoryBigInteger,PropertyFactoryBoolean,PropertyFactoryByte,PropertyFactoryDouble,PropertyFactoryFloat,PropertyFactoryId,PropertyFactoryInstant,PropertyFactoryInteger,PropertyFactoryLink,PropertyFactoryList,PropertyFactoryLocalDate,PropertyFactoryLocalDateTime,PropertyFactoryLocalTime,PropertyFactoryLong,PropertyFactoryMap,PropertyFactoryObject,PropertyFactoryOffsetDateTime,PropertyFactoryOffsetTime,PropertyFactoryRange,PropertyFactorySet,PropertyFactoryShort,PropertyFactoryString,PropertyFactoryZonedDateTime
public interface PropertyFactory<V,P extends WritableProperty<V>>This is the interface for the factory of a specificpropertytype. You can directly instantiate implementations such asStringProperty. However for generic support according types have to be registered via an implementation of this interface.- Since:
- 1.0.0
- See Also:
PropertyFactoryManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Pcreate(String name, Class<? extends V> valueClass, PropertyMetadata<V> metadata)Creates a new instance of the property.Class<P>getImplementationClass()Class<? extends ReadableProperty<V>>getReadableInterface()Class<? extends V>getValueClass()Class<? extends WritableProperty<V>>getWritableInterface()default booleanisPolymorphic()
-
-
-
Method Detail
-
getValueClass
Class<? extends V> getValueClass()
- Returns:
- the
Classof theproperty value. May benullfor a generic property.
-
getReadableInterface
Class<? extends ReadableProperty<V>> getReadableInterface()
- Returns:
- the
Classreflecting theReadablePropertyinterface. May benullif no dedicated readable interface exists.
-
getWritableInterface
Class<? extends WritableProperty<V>> getWritableInterface()
- Returns:
- the
Classreflecting theWritablePropertyinterface. May benullif no dedicated writable interface exists.
-
getImplementationClass
Class<P> getImplementationClass()
- Returns:
- the
Classreflecting theWritablePropertyimplementation.
-
create
P create(String name, Class<? extends V> valueClass, PropertyMetadata<V> metadata)
Creates a new instance of the property.- Parameters:
name- theproperty name.valueClass- thevalue class.metadata- TODO- Returns:
- the new instance of the property.
-
isPolymorphic
default boolean isPolymorphic()
- Returns:
trueifvalue classis polymorphic and also sub-types are handled by thisPropertyFactory(unless there is a more specificPropertyFactoryavailable),falseotherwise.
-
-