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 TypeMethodDescriptionboolean
getField()
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.boolean
Returns whether the property exposes a getter or a setter.int
hashCode()
boolean
Returns whether the property is backed by a field.static Property
of
(TypeInformation<?> type, PropertyDescriptor descriptor) Creates a newProperty
for the givenPropertyDescriptor
.static Property
of
(TypeInformation<?> type, Field field) Creates a newProperty
backed by the given field.static Property
of
(TypeInformation<?> type, Field field, PropertyDescriptor descriptor) static boolean
supportsStandalone
(PropertyDescriptor descriptor) Returns whether the givenPropertyDescriptor
is supported in for standalone creation of aProperty
instance.toString()
-
Method Details
-
of
Creates a newProperty
backed 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 newProperty
for 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 givenPropertyDescriptor
is supported in for standalone creation of aProperty
instance.- 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
-