T
- Property value typeP
- Property typeB
- Concrete builder typepublic static interface Property.Builder<T,P extends Property<T>,B extends Property.Builder<T,P,B>> extends Localizable.Builder<B>
Property
builder.Modifier and Type | Method and Description |
---|---|
default <C> B |
configuration(ConfigProperty<C> configurationProperty,
C value)
Deprecated.
|
default B |
configuration(String parameterName,
Object value)
Deprecated.
|
<MODEL> B |
converter(Class<MODEL> modelType,
Function<MODEL,T> fromModel,
Function<T,MODEL> toModel)
Set a
PropertyValueConverter for given modelType using given conversion
Function s: the fromModel function to convert a model type value into property value
type, and the toModel function to perform the inverse operation, i.e. convert the property value
type into model type. |
B |
converter(PropertyValueConverter<T,?> converter)
Sets the
PropertyValueConverter . |
B |
equalsHandler(EqualsHandler<? super P> equalsHandler)
Set the predicate to use to check the property equality using the
Object.equals(Object) method. |
B |
hashCodeProvider(HashCodeProvider<? super P> hashCodeProvider)
Set the function to use to provide the property hash code using the
Object.hashCode() method. |
B |
localization(Localizable localizable)
Set the property localization using given
Localizable definition. |
B |
temporalType(TemporalType temporalType)
Set the optional
TemporalType specification for Date or Calendar type properties,
which can be used to perform consistent operations on property value, such as presentation, rendering or
persistence data manipulation. |
default B |
validator(Validator<T> validator)
Deprecated.
|
default <C> B |
withConfiguration(ConfigProperty<C> configurationProperty,
C value)
Add a property configuration parameter using a
ConfigProperty , with ConfigProperty.getKey()
as parameter name. |
B |
withConfiguration(String parameterName,
Object value)
Add a property configuration parameter
|
B |
withValidator(Validator<T> validator)
Add a property value
Validator |
message, message, messageArguments, messageCode
B localization(Localizable localizable)
Localizable
definition.localizable
- The localizable to use to obtain property localization attributes (not null)B withConfiguration(String parameterName, Object value)
parameterName
- Parameter name to add to property configuration (not null)value
- Configuration parameter value@Deprecated default B configuration(String parameterName, Object value)
withConfiguration(String, Object)
parameterName
- Parameter name to add to property configuration (not null)value
- Configuration parameter valuedefault <C> B withConfiguration(ConfigProperty<C> configurationProperty, C value)
ConfigProperty
, with ConfigProperty.getKey()
as parameter name.C
- Config property typeconfigurationProperty
- ConfigProperty to add to property configuration (not null)value
- Configuration parameter value@Deprecated default <C> B configuration(ConfigProperty<C> configurationProperty, C value)
withConfiguration(ConfigProperty, Object)
ConfigProperty
, with ConfigProperty.getKey()
as parameter name.C
- Config property typeconfigurationProperty
- ConfigProperty to add to property configuration (not null)value
- Configuration parameter valueB temporalType(TemporalType temporalType)
TemporalType
specification for Date
or Calendar
type properties,
which can be used to perform consistent operations on property value, such as presentation, rendering or
persistence data manipulation.temporalType
- the property TemporalType
to setB converter(PropertyValueConverter<T,?> converter)
PropertyValueConverter
.converter
- The converter to set<MODEL> B converter(Class<MODEL> modelType, Function<MODEL,T> fromModel, Function<T,MODEL> toModel)
PropertyValueConverter
for given modelType
using given conversion
Function
s: the fromModel
function to convert a model type value into property value
type, and the toModel
function to perform the inverse operation, i.e. convert the property value
type into model type. Then set this converter as PropertyValueConverter
for the property.MODEL
- Model typemodelType
- Model type class (not null)fromModel
- Function to convert a model type value into property value type (not null)toModel
- Function to convert a property value type value into model type (not null)B withValidator(Validator<T> validator)
Validator
validator
- Validator to add (not null)@Deprecated default B validator(Validator<T> validator)
withValidator(Validator)
Validator
validator
- Validator to add (not null)B equalsHandler(EqualsHandler<? super P> equalsHandler)
Object.equals(Object)
method.
If a custom equals
handler is provided, a hashCode
provider should be provided too,
using the hashCodeProvider(HashCodeProvider)
builder mthod.
equalsHandler
- The function to use to check property equalityB hashCodeProvider(HashCodeProvider<? super P> hashCodeProvider)
Object.hashCode()
method.hashCodeProvider
- The function to use to provide the property hash codeCopyright © 2019 The Holon Platform. All rights reserved.