java.lang.Object
io.github.mmm.bean.BeanHelper
Class with helper methods for internal reuse to avoid redundancies.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcomputeSize(ReadableBean bean, io.github.mmm.marshall.size.StructuredFormatSizeComputor computor, PropertyIdMapping idMapping) ATTENTION: This is an internal method that should not be used from outside of this project.static voidcopy(AbstractBean source, AbstractBean copy, boolean readOnly) static PropertyFactory<?,?> getPropertyFactory(Class<?> type) static StringgetPropertyName4Getter(String getter) static StringgetPropertyName4Property(Method method) static StringgetPropertyName4Setter(String setter) getPropertyNames(ReadableBean bean)
-
Constructor Details
-
BeanHelper
public BeanHelper()
-
-
Method Details
-
copy
- Parameters:
source- the source bean to copy from.copy- the target bean to copy to.readOnly- -trueif the copy shall be read-only,falseotherwise.- See Also:
-
getPropertyName4Getter
- Parameters:
getter- the name of a method that is potentially a getter.- Returns:
- the property name for the given
getterornullif not a getter.
-
getPropertyName4Setter
- Parameters:
setter- the name of a method that is potentially a setter.- Returns:
- the property name for the given
setterornullif not a setter.
-
getPropertyName4Property
-
getPropertyFactory
- Parameters:
type- theClassreflecting theReadablePropertyto get thePropertyFactoryfor.- Returns:
- the
PropertyFactoryfor the given propertyClassornullif not a property.
-
getPropertyNames
- Parameters:
bean- theReadableBean.- Returns:
- the
Setwith the names of theproperties.
-
computeSize
public static int computeSize(ReadableBean bean, io.github.mmm.marshall.size.StructuredFormatSizeComputor computor, PropertyIdMapping idMapping) ATTENTION: This is an internal method that should not be used from outside of this project.- Parameters:
bean- theReadableBean.computor- theStructuredFormatSizeComputor.idMapping- thePropertyIdMapping.- Returns:
- the computed size.
-