public class ClassicBeanStyleWithOptionalSupport extends ClassicBeanStyle
BeanStyle implementation that is identical to the
ClassicBeanStyle but has also Optional support. The
difference to the ClassicBeanStyle is that for a property of type
T it allows a getter method that either returns T
or Optional<T>.| Modifier and Type | Field and Description |
|---|---|
static ClassicBeanStyleWithOptionalSupport |
INSTANCE |
CLASSIC, CLASSIC_WITH_OPTIONAL, MODERN| Modifier | Constructor and Description |
|---|---|
protected |
ClassicBeanStyleWithOptionalSupport()
INSTANCE should be the only instance. |
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
determineFieldTypeFromGetterAndSetter(Class<?> beanType,
Method getterMethod,
Method setterMethod)
Determines the type of a bean field from given corresponding getter and
setter method.
|
convertGetterNameToFieldName, convertSetterNameToFieldName, hasGetterMethodSignature, hasSetterMethodSignature, isGetterMethod, isSetterMethodassertForBeanType, equals, hashCode, isNoParameterInMethod, isOneParameterInMethodpublic static final ClassicBeanStyleWithOptionalSupport INSTANCE
protected ClassicBeanStyleWithOptionalSupport()
INSTANCE should be the only instance.public Class<?> determineFieldTypeFromGetterAndSetter(Class<?> beanType, Method getterMethod, Method setterMethod) throws InvalidIBeanTypeException
BeanStyledetermineFieldTypeFromGetterAndSetter in class ClassicBeanStylebeanType - the examined bean classgetterMethod - a method of the beanType that is proven to be a
potential gettersetterMethod - a method of the beanType that is proven to be a
potential setterInvalidIBeanTypeException - if either the type cannot be determined for any reason or if
the concluded types of setter and getter do not match