public class Property extends Object
Field
and / or a PropertyDescriptor
.Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
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.
|
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(Field field)
Creates a new
Property backed by the given field. |
static Property |
of(Field field,
PropertyDescriptor descriptor)
|
static Property |
of(PropertyDescriptor descriptor)
Creates a new
Property for the given PropertyDescriptor . |
String |
toString() |
public static Property of(Field field)
Property
backed by the given field.field
- must not be null.public static Property of(Field field, PropertyDescriptor descriptor)
field
- must not be null.descriptor
- must not be null.public static Property of(PropertyDescriptor descriptor)
Property
for the given PropertyDescriptor
.descriptor
- must not be null.public boolean isFieldBacked()
public Optional<Method> getGetter()
public Optional<Method> getSetter()
public boolean hasAccessor()
public String getName()
public Class<?> getType()
Copyright © 2011-2016–2017 Pivotal Software, Inc.. All rights reserved.