Package org.springframework.core.convert

# Class Property

java.lang.Object
org.springframework.core.convert.Property

public final class Property extends Object
A description of a JavaBeans Property that allows us to avoid a dependency on `java.beans.PropertyDescriptor`. The `java.beans` package is not available in a number of environments (for example, Android, Java ME), so this is desirable for portability of Spring's core conversion facility.

Used to build a `TypeDescriptor` from a property location. The built `TypeDescriptor` can then be used to convert from/to the property type.

Since:
  3.1
Author:
  Keith Donald, Phillip Webb
See Also:
  - `TypeDescriptor(Property)`
  - `TypeDescriptor.nested(Property, int)`

## Constructor Summary

Constructors
Constructor
Description
`Property(Class<?> objectType, Method readMethod, Method writeMethod)`
`Property(Class<?> objectType, Method readMethod, Method writeMethod, String name)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object other)`
`String`
`getName()`
The name of the property: for example, 'foo'.
`Class<?>`
`getObjectType()`
The object declaring this property, either directly or in a superclass the object extends.
`Method`
`getReadMethod()`
The property getter method: for example, `getFoo()`.
`Class<?>`
`getType()`
The property type: for example, `java.lang.String`.
`Method`
`getWriteMethod()`
The property setter method: for example, `setFoo(String)`.
`int`
`hashCode()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Property

public Property(Class<?> objectType, @Nullable Method readMethod, @Nullable Method writeMethod)

### Property

public Property(Class<?> objectType, @Nullable Method readMethod, @Nullable Method writeMethod, @Nullable String name)

## Method Details

### getObjectType

public Class<?> getObjectType()
The object declaring this property, either directly or in a superclass the object extends.

### getName

public String getName()
The name of the property: for example, 'foo'.

### getType

public Class<?> getType()
The property type: for example, `java.lang.String`.

### getReadMethod

@Nullable public Method getReadMethod()
The property getter method: for example, `getFoo()`.

### getWriteMethod

@Nullable public Method getWriteMethod()
The property setter method: for example, `setFoo(String)`.

### equals

public boolean equals(@Nullable Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`