public class Property extends Object
Field
and / or a PropertyDescriptor
.Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Optional<Field> |
getField()
Returns the field of the property if available and if its first (only) parameter matches the type of the property.
|
Optional<Method> |
getGetter()
Returns the getter of the property if available and if it matches the type of the property.
|
String |
getName()
Returns the name of the property.
|
Optional<Method> |
getSetter()
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.
|
Optional<Method> |
getWither()
Returns the wither of the property if available and if its first (only) parameter matches the type of the property.
|
boolean |
hasAccessor()
Returns whether the property exposes a getter or a setter.
|
int |
hashCode() |
boolean |
isFieldBacked()
Returns whether the property is backed by a field.
|
static Property |
of(TypeInformation<?> type,
Field field)
Creates a new
Property backed by the given field. |
static Property |
of(TypeInformation<?> type,
Field field,
PropertyDescriptor descriptor)
|
static Property |
of(TypeInformation<?> type,
PropertyDescriptor descriptor)
Creates a new
Property for the given PropertyDescriptor . |
static boolean |
supportsStandalone(PropertyDescriptor descriptor)
Returns whether the given
PropertyDescriptor is supported in for standalone creation of a Property
instance. |
String |
toString() |
public static Property of(TypeInformation<?> type, Field field)
Property
backed by the given field.type
- the owning type, must not be null.field
- must not be null.public static Property of(TypeInformation<?> type, Field field, PropertyDescriptor descriptor)
type
- the owning type, must not be null.field
- must not be null.descriptor
- must not be null.public static Property of(TypeInformation<?> type, PropertyDescriptor descriptor)
Property
for the given PropertyDescriptor
. The creation might fail if the given
property is not representing a proper property.type
- the owning type, must not be null.descriptor
- must not be null.supportsStandalone(PropertyDescriptor)
public static boolean supportsStandalone(PropertyDescriptor descriptor)
PropertyDescriptor
is supported in for standalone creation of a Property
instance.descriptor
- public boolean isFieldBacked()
public Optional<Method> getGetter()
public Optional<Method> getSetter()
public Optional<Method> getWither()
public Optional<Field> getField()
public boolean hasAccessor()
public String getName()
public Class<?> getType()
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.