Class BeanMapEntry
This class can be used to get and set property values on a bean, or to get metadata on a property.
Example:
Thread safety
This is a lightweight immutable view over aBeanMap.
Its thread-safety characteristics are the same as the backing BeanMap.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBeanMapEntry(BeanMap<?> beanMap, BeanPropertyMeta property, String pName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrue if the given object is aMap.Entrywith equal key and value.BeanMap<?>Returns the bean map that contains this property.getKey()getMeta()Returns the metadata about this bean property.getValue()Returns the value of this property.inthashCode()Returns the hash code for this entry, consistent with theMap.Entrycontract.Sets the value of this property.toString()
-
Constructor Details
-
BeanMapEntry
Constructor.- Parameters:
beanMap- The bean map that this entry belongs to.property- The bean property.pName- The bean property name.
-
-
Method Details
-
getBeanMap
Returns the bean map that contains this property.- Returns:
- The bean map that contains this property.
-
getKey
-
getMeta
Returns the metadata about this bean property.- Returns:
- Metadata about this bean property.
-
getValue
Returns the value of this property.If there is a
ObjectSwapassociated with this bean property or bean property type class, then this method will return the transformed value. For example, if the bean property type class is aDateand the bean property has theDateFormat.ISO_INSTANTsetting associated with it through the@Swap(value)annotation, this method will return a String containing an ISO8601 date-time string value. -
setValue
Sets the value of this property.If the property is an array of type
X, then the value can be aCollection<X>orX[]orObject[].If the property is a bean type
X, then the value can either be anXor aMap.If there is a
ObjectSwapassociated with this bean property or bean property type class, then you must pass in a transformed value. For example, if the bean property type class is aDateand the bean property has theDateFormat.ISO_INSTANTsetting associated with it through the@Swap(value)annotation, the value being passed in must be a String containing an ISO8601 date-time string value. -
equals
Returnstrue if the given object is aMap.Entrywith equal key and value.This follows the
Map.Entryequality contract: two entries are equal if both their keys and values compare equal viaObjects.equals(java.lang.Object, java.lang.Object). -
hashCode
Returns the hash code for this entry, consistent with theMap.Entrycontract.The hash code is computed as
key.hashCode() ^ value.hashCode(), matching the contract that equal entries must have equal hash codes. -
toString
-