- java.lang.Object
-
- org.joda.beans.ser.SerOptional
-
public class SerOptional extends java.lang.ObjectAssists with serialization and deserialization of optional properties.
-
-
Constructor Summary
Constructors Constructor Description SerOptional()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<?>extractType(MetaProperty<?> metaProp, java.lang.Class<?> beanType)Extracts the value of the property from a bean, unwrapping any optional.static java.lang.ObjectextractValue(MetaProperty<?> metaProp, Bean bean)Extracts the value of the property from a bean, unwrapping any optional.static java.lang.ObjectwrapValue(MetaProperty<?> metaProp, java.lang.Class<?> beanType, java.lang.Object value)Wraps the value of a property if it is an optional.
-
-
-
Method Detail
-
extractValue
public static java.lang.Object extractValue(MetaProperty<?> metaProp, Bean bean)
Extracts the value of the property from a bean, unwrapping any optional.- Parameters:
metaProp- the property to query, not nullbean- the bean to query, not null- Returns:
- the value of the property, with any optional wrapper removed
-
extractType
public static java.lang.Class<?> extractType(MetaProperty<?> metaProp, java.lang.Class<?> beanType)
Extracts the value of the property from a bean, unwrapping any optional.- Parameters:
metaProp- the property to query, not nullbeanType- the type of the bean, not null- Returns:
- the type of the property with any optional wrapper removed
-
wrapValue
public static java.lang.Object wrapValue(MetaProperty<?> metaProp, java.lang.Class<?> beanType, java.lang.Object value)
Wraps the value of a property if it is an optional.- Parameters:
metaProp- the property to query, not nullbeanType- the type of the bean, not nullvalue- the value to wrap, may be null- Returns:
- the value of the property, with any optional wrapper added
-
-