T
- The type of entitypublic abstract class MetaDataBuilder<T> extends Object
EntityMetaData
instances.MapMetaData.Builder
Modifier and Type | Field and Description |
---|---|
protected Constraint<? super T> |
constraint
Constraint to be used for entity validation.
|
protected LinkedHashMap<String,PropertyMetaData<T,?>> |
properties
Metadata of all the properties defined on the entity.
|
Modifier | Constructor and Description |
---|---|
protected |
MetaDataBuilder()
Constructs a new
MetaDataBuilder . |
Modifier and Type | Method and Description |
---|---|
abstract <M extends EntityMetaData<T>> |
build()
Builds a new
EntityMetaData instance. |
void |
clear()
Removes all the properties and clears entity constraint.
|
MetaDataBuilder<T> |
constraint(Constraint<? super T> constraint)
Defines constraint to be used for entity validation.
|
<V> MetaDataBuilder<T> |
property(String name,
Class<V> type)
Defines a property with the specified name and type.
|
<V> MetaDataBuilder<T> |
property(String name,
Class<V> type,
Constraint<? super V> constraint)
Defines a property with the specified name, type and constraint.
|
<V> MetaDataBuilder<T> |
property(String name,
Class<V> type,
Constraint<? super V> constraint,
V defaultValue)
Defines a property with the specified name, type, constraint and
default value.
|
<V> MetaDataBuilder<T> |
property(String name,
Class<V> type,
V defaultValue)
Defines a property with the specified name, type and default value.
|
<V> MetaDataBuilder<T> |
property(String name,
Converter<V> converter)
Defines a property with the specified name and converter.
|
<V> MetaDataBuilder<T> |
property(String name,
Converter<V> converter,
Constraint<? super V> constraint)
Defines a property with the specified name, converter and constraint.
|
abstract <V> MetaDataBuilder<T> |
property(String name,
Converter<V> converter,
Constraint<? super V> constraint,
V defaultValue)
Defines a property with the specified name, converter, constraint
and default value.
|
<V> MetaDataBuilder<T> |
property(String name,
Converter<V> converter,
V defaultValue)
Defines a property with the specified name, converter and default
value.
|
protected Constraint<? super T> constraint
protected final LinkedHashMap<String,PropertyMetaData<T,?>> properties
public <V> MetaDataBuilder<T> property(String name, Class<V> type)
V
- The property value type.name
- Property name.type
- Property type.public <V> MetaDataBuilder<T> property(String name, Class<V> type, V defaultValue)
V
- The property value type.name
- Property name.type
- Property type.defaultValue
- Property default value.public <V> MetaDataBuilder<T> property(String name, Class<V> type, Constraint<? super V> constraint)
V
- The property value type.name
- Property name.type
- Property type.constraint
- Constraint to be used for property value validation.public <V> MetaDataBuilder<T> property(String name, Class<V> type, Constraint<? super V> constraint, V defaultValue)
V
- The property value type.name
- Property name.type
- Property type.constraint
- Constraint to be used for property value validation.defaultValue
- Property default value.public <V> MetaDataBuilder<T> property(String name, Converter<V> converter)
V
- The property value type.name
- Property name.converter
- Converter to be used for property value conversion
into and from string.public <V> MetaDataBuilder<T> property(String name, Converter<V> converter, V defaultValue)
V
- The property value type.name
- Property name.converter
- Converter to be used for property value conversion
into and from string.defaultValue
- Property default value.public <V> MetaDataBuilder<T> property(String name, Converter<V> converter, Constraint<? super V> constraint)
V
- The property value type.name
- Property name.converter
- Converter to be used for property value conversion
into and from string.constraint
- Constraint to be used for property value validation.public abstract <V> MetaDataBuilder<T> property(String name, Converter<V> converter, Constraint<? super V> constraint, V defaultValue)
V
- The property value type.name
- Property name.converter
- Converter to be used for property value conversion
into and from string.constraint
- Constraint to be used for property value validation.defaultValue
- Property default value.public MetaDataBuilder<T> constraint(Constraint<? super T> constraint)
constraint
- Constraint to be used for entity validation.public void clear()
public abstract <M extends EntityMetaData<T>> M build()
EntityMetaData
instance.M
- The metadata type.EntityMetaData
instance.Copyright © 2011–2020 FoxLabs. All rights reserved.