Class Property
java.lang.Object
org.springframework.data.mapping.model.Property
Value object to abstract the concept of a property backed by a
Field and / or a PropertyDescriptor.- Author:
- Oliver Gierke, Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionbooleangetField()Returns the field of the property if available and if its first (only) parameter matches the type of the property.Returns the getter of the property if available and if it matches the type of the property.getName()Returns the name of the property.Returns the setter of the property if available and if its first (only) parameter matches the type of the property.Class<?>getType()Returns the type of the property.Returns the wither of the property if available and if its first (only) parameter matches the type of the property.booleanReturns whether the property exposes a getter or a setter.inthashCode()booleanReturns whether the property is backed by a field.static Propertyof(TypeInformation<?> type, PropertyDescriptor descriptor) Creates a newPropertyfor the givenPropertyDescriptor.static Propertyof(TypeInformation<?> type, Field field) Creates a newPropertybacked by the given field.static Propertyof(TypeInformation<?> type, Field field, PropertyDescriptor descriptor) static booleansupportsStandalone(PropertyDescriptor descriptor) Returns whether the givenPropertyDescriptoris supported in for standalone creation of aPropertyinstance.toString()
-
Method Details
-
of
Creates a newPropertybacked by the given field.- Parameters:
type- the owning type, must not be null.field- must not be null.- Returns:
-
of
- Parameters:
type- the owning type, must not be null.field- must not be null.descriptor- must not be null.- Returns:
-
of
Creates a newPropertyfor the givenPropertyDescriptor. The creation might fail if the given property is not representing a proper property.- Parameters:
type- the owning type, must not be null.descriptor- must not be null.- Returns:
- See Also:
-
supportsStandalone
Returns whether the givenPropertyDescriptoris supported in for standalone creation of aPropertyinstance.- Parameters:
descriptor-- Returns:
-
isFieldBacked
public boolean isFieldBacked()Returns whether the property is backed by a field.- Returns:
-
getGetter
Returns the getter of the property if available and if it matches the type of the property.- Returns:
- will never be null.
-
getSetter
Returns the setter of the property if available and if its first (only) parameter matches the type of the property.- Returns:
- will never be null.
-
getWither
Returns the wither of the property if available and if its first (only) parameter matches the type of the property.- Returns:
- will never be null.
-
getField
Returns the field of the property if available and if its first (only) parameter matches the type of the property.- Returns:
- will never be null.
-
hasAccessor
public boolean hasAccessor()Returns whether the property exposes a getter or a setter.- Returns:
-
getName
Returns the name of the property.- Returns:
- will never be null.
-
getType
Returns the type of the property.- Returns:
- will never be null.
-
equals
-
hashCode
public int hashCode() -
toString
-