|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joda.beans.impl.BasicProperty<P>
P - the type of the property contentpublic final class BasicProperty<P>
A property that binds a Bean to a MetaProperty.
This is the standard implementation of a property. It defers the strategy of getting and setting the value to the meta-property.
This implementation is also a map entry to aid performance in maps.
| Method Summary | ||
|---|---|---|
|
bean()
Gets the bean which owns this property. |
|
boolean |
equals(Object obj)
Checks if this property equals another. |
|
P |
get()
Gets the value of the property for the associated bean. |
|
int |
hashCode()
Returns a suitable hash code. |
|
MetaProperty<P> |
metaProperty()
Gets the meta-property representing the parts of the property that are common across all instances, such as the name. |
|
String |
name()
Gets the property name. |
|
static
|
of(Bean bean,
MetaProperty<P> metaProperty)
Factory to create a property avoiding duplicate generics. |
|
P |
put(Object value)
Sets the value of the property on the associated bean and returns the previous value. |
|
void |
set(Object value)
Sets the value of the property on the associated bean. |
|
String |
toString()
Returns a string that summarises the property. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static <P> BasicProperty<P> of(Bean bean,
MetaProperty<P> metaProperty)
P - the property typebean - the bean that the property is bound to, not nullmetaProperty - the meta property, not null
public <B extends Bean> B bean()
PropertyEach property is fully owned by a single bean.
bean in interface Property<P>B - the bean type
public MetaProperty<P> metaProperty()
Property
metaProperty in interface Property<P>public String name()
PropertyThe JavaBean style methods getFoo() and setFoo() will lead to a property name of 'foo' and so on.
name in interface Property<P>public P get()
Property
For a JavaBean, this is the equivalent to calling getFoo() on the bean itself.
Alternate implementations may perform any logic to obtain the value.
get in interface Property<P>public void set(Object value)
Property
The value must be of the correct type for the property.
See the meta-property for string conversion.
For a standard JavaBean, this is equivalent to calling setFoo() on the bean.
Alternate implementations may perform any logic to change the value.
set in interface Property<P>value - the value to set into the property on the beanpublic P put(Object value)
Property
This is a combination of the get and set methods that matches the definition
of put in a Map.
put in interface Property<P>value - the value to set into the property on the bean
public boolean equals(Object obj)
PropertyThis compares the meta-property and value. It does not consider the property or bean types.
equals in interface Property<P>equals in class Objectobj - the other property, null returns false
public int hashCode()
Property
hashCode in interface Property<P>hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||