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 <B extends WritableBean>
voidcopy(B source, B target) static voidcopyUnsafe(ReadableBean source, WritableBean target) 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
-
copyUnsafe
-
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.
-