Class ClassTool


  • public class ClassTool
    extends Object
    Utility functions for manipulating classes and resources and for other programming language aspects
    Since:
    7.5.1
    Author:
    Marco Meschieri - LogicalDOC
    • Constructor Detail

      • ClassTool

        public ClassTool()
    • Method Detail

      • isNull

        public boolean isNull​(Object instance)
        Checks if a given instance is null
        Parameters:
        instance - the object to evaluate
        Returns:
        true only if the passed instance is null
      • isEmpty

        public boolean isEmpty​(String str)
        Checks if a given string is null or empty
        Parameters:
        str - the string to evaluate
        Returns:
        true only if the passed string is null or empty
      • copy

        public Object copy​(Object instance)
        Makes a copy(clone) of a given object instance.

        Attention: for security reasons it will not be used the cloned() method of the given objet but a new instance of the given object's class is invoked by passing the same instance. As a result they may be copied only those objects that define a public construction that accepts the same class as single argument.

        Parameters:
        instance - the object to clone
        Returns:
        the cloned object