- 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 void
copy(AbstractBean source, AbstractBean copy, boolean readOnly)
static io.github.mmm.property.factory.PropertyFactory<?,?>
getPropertyFactory(Class<?> type)
static String
getPropertyName4Getter(String getter)
static String
getPropertyName4Property(Method method)
static String
getPropertyName4Setter(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
- -true
if the copy shall be read-only,false
otherwise.- 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
getter
ornull
if 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
setter
ornull
if not a setter.
-
getPropertyFactory
public static io.github.mmm.property.factory.PropertyFactory<?,?> getPropertyFactory(Class<?> type)
- Parameters:
type
- theClass
reflecting theReadableProperty
to get thePropertyFactory
for.- Returns:
- the
PropertyFactory
for the given propertyClass
ornull
if not a property.
-
getPropertyNames
public static Set<String> getPropertyNames(ReadableBean bean)
- Parameters:
bean
- theReadableBean
.- Returns:
- the
Set
with the names of theproperties
.
-
-