T
- The type of entitypublic abstract class AbstractEntityMetaData<T> extends Object implements EntityMetaData<T>
EntityMetaData
interface.Modifier and Type | Field and Description |
---|---|
protected Constraint<? super T> |
constraint
Constraint to be used for entity validation.
|
protected Map<String,PropertyMetaData<T,Object>> |
properties
Metadata of all the properties defined on the entity.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractEntityMetaData(Constraint<? super T> constraint,
Map<String,? extends PropertyMetaData<T,Object>> properties)
Constructs a new
AbstractEntityMetaData with the specified
entity constraint and properties metadata. |
Modifier and Type | Method and Description |
---|---|
T |
cast(Object entity)
Casts the specified entity to this entity type.
|
boolean |
equals(Object obj)
Determines if this entity metadata equals to the specified one.
|
Collection<PropertyMetaData<T,Object>> |
getAllPropertyMetaData()
Returns metadata of all the properties defined on the entity.
|
Constraint<? super T> |
getConstraint()
Returns constraint to be used for entity validation.
|
<V> PropertyMetaData<T,V> |
getPropertyMetaData(String property)
Returns metadata for the specified property.
|
Set<String> |
getPropertyNames()
Returns set of property names.
|
int |
hashCode()
Returns a hash code value for this entity metadata.
|
boolean |
hasProperty(String property)
Determines if this entity metadata contains the specified property.
|
String |
toString()
Returns string representing this entity metadata.
|
protected final Constraint<? super T> constraint
protected final Map<String,PropertyMetaData<T,Object>> properties
protected AbstractEntityMetaData(Constraint<? super T> constraint, Map<String,? extends PropertyMetaData<T,Object>> properties)
AbstractEntityMetaData
with the specified
entity constraint and properties metadata.constraint
- Constraint to be used for entity validation.properties
- Metadata of all the properties defined on the entity.public final Constraint<? super T> getConstraint()
null
.getConstraint
in interface MetaData<T>
public final Set<String> getPropertyNames()
getPropertyNames
in interface EntityMetaData<T>
public boolean hasProperty(String property)
hasProperty
in interface EntityMetaData<T>
property
- Property name.true
if this entity metadata contains the specified
property; false
otherwise.public final <V> PropertyMetaData<T,V> getPropertyMetaData(String property)
getPropertyMetaData
in interface EntityMetaData<T>
V
- The property value type.property
- Property name.IllegalArgumentException
- if the specified property not exists.public final Collection<PropertyMetaData<T,Object>> getAllPropertyMetaData()
getAllPropertyMetaData
in interface EntityMetaData<T>
public T cast(Object entity)
cast
in interface MetaData<T>
entity
- Entity to be cast.ClassCastException
- if the specified entity is not assignable to
this entity type.public int hashCode()
public boolean equals(Object obj)
Copyright © 2011–2020 FoxLabs. All rights reserved.