Class ObjectUtils


  • public class ObjectUtils
    extends java.lang.Object
    A class for auxiliary manipulations with objects.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T clonePojo​(T pojoObject, java.lang.Class<T> clazz)
      Clone POJO object through ObjectMapper to avoid implementation of clone method and model modification.
      static java.lang.String toString​(java.lang.Object pojoObject)
      Convert POJO object through ObjectMapper to a string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toString

        @Nonnull
        public static java.lang.String toString​(@Nonnull
                                                java.lang.Object pojoObject)
        Convert POJO object through ObjectMapper to a string.
        Parameters:
        pojoObject - an object to convert
        Returns:
        representation of the object
      • clonePojo

        @Nonnull
        public static <T> T clonePojo​(@Nonnull
                                      T pojoObject,
                                      java.lang.Class<T> clazz)
        Clone POJO object through ObjectMapper to avoid implementation of clone method and model modification.
        Type Parameters:
        T - the clone object type
        Parameters:
        pojoObject - an object to clone
        clazz - the clone object type
        Returns:
        cloned object