Package org.joda.beans.impl
Class BasicProperty<P>
- java.lang.Object
-
- org.joda.beans.impl.BasicProperty<P>
-
- Type Parameters:
P
- the type of the property content
- All Implemented Interfaces:
Property<P>
public final class BasicProperty<P> extends Object implements Property<P>
A property that binds aBean
to aMetaProperty
.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <B extends Bean>
Bbean()
Gets the bean which owns this property.boolean
equals(Object obj)
Checks if this property equals another.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.static <P> BasicProperty<P>
of(Bean bean, MetaProperty<P> metaProperty)
Factory to create a property avoiding duplicate generics.String
toString()
Returns a string that summarises the property.
-
-
-
Method Detail
-
of
public static <P> BasicProperty<P> of(Bean bean, MetaProperty<P> metaProperty)
Factory to create a property avoiding duplicate generics.- Type Parameters:
P
- the property type- Parameters:
bean
- the bean that the property is bound to, not nullmetaProperty
- the meta property, not null- Returns:
- the property, not null
-
bean
public <B extends Bean> B bean()
Description copied from interface:Property
Gets the bean which owns this property.Each property is fully owned by a single bean.
-
metaProperty
public MetaProperty<P> metaProperty()
Description copied from interface:Property
Gets the meta-property representing the parts of the property that are common across all instances, such as the name.- Specified by:
metaProperty
in interfaceProperty<P>
- Returns:
- the meta-property, not null
-
equals
public boolean equals(Object obj)
Description copied from interface:Property
Checks if this property equals another.This compares the meta-property and value. It does not consider the property or bean types.
-
hashCode
public int hashCode()
Description copied from interface:Property
Returns a suitable hash code.
-
-