- java.lang.Object
-
- io.github.mmm.bean.BeanHelper
-
public class BeanHelper extends Object
Class with helper methods for internal reuse to avoid redundancies.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description BeanHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopy(AbstractBean source, AbstractBean copy, boolean readOnly)static io.github.mmm.property.factory.PropertyFactory<?,?>getPropertyFactory(Class<?> type)static StringgetPropertyName4Getter(String getter)static StringgetPropertyName4Property(Method method)static StringgetPropertyName4Setter(String setter)static Set<String>getPropertyNames(ReadableBean bean)
-
-
-
Method Detail
-
copy
public static void copy(AbstractBean source, AbstractBean copy, boolean readOnly)
- 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:
ReadableBean.copy(boolean)
-
getPropertyName4Getter
public static String getPropertyName4Getter(String getter)
- Parameters:
getter- the name of a method that is potentially a getter.- Returns:
- the property name for the given
getterornullif not a getter.
-
getPropertyName4Setter
public static String getPropertyName4Setter(String setter)
- Parameters:
setter- the name of a method that is potentially a setter.- Returns:
- the property name for the given
setterornullif not a setter.
-
getPropertyFactory
public static io.github.mmm.property.factory.PropertyFactory<?,?> getPropertyFactory(Class<?> type)
- Parameters:
type- theClassreflecting theReadablePropertyto get thePropertyFactoryfor.- Returns:
- the
PropertyFactoryfor the given propertyClassornullif not a property.
-
getPropertyNames
public static Set<String> getPropertyNames(ReadableBean bean)
- Parameters:
bean- theReadableBean.- Returns:
- the
Setwith the names of theproperties.
-
-