Class BeanHelper


  • public class BeanHelper
    extends Object
    Class with helper methods for internal reuse to avoid redundancies.
    Since:
    1.0.0
    • Constructor Detail

      • BeanHelper

        public BeanHelper()
    • 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 or null 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 or null if not a setter.
      • getPropertyName4Property

        public static String getPropertyName4Property​(Method method)
        Parameters:
        method - the Method to check.
        Returns:
        the property name for the given Method or null if not a property Method.
      • getPropertyFactory

        public static io.github.mmm.property.factory.PropertyFactory<?,​?> getPropertyFactory​(Class<?> type)
        Parameters:
        type - the Class reflecting the ReadableProperty to get the PropertyFactory for.
        Returns:
        the PropertyFactory for the given property Class or null if not a property.