Class ReflectToStringHelper


  • public final class ReflectToStringHelper
    extends java.lang.Object
    Used org.hibernate.internal.util.ReflectHelper as basis, which only support equals and hashcode this helps to check if toString is overriden so that by default we can support toString without it hydrating the proxy.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.Class[] NO_PARAM_SIGNATURE  
      static java.lang.Object[] NO_PARAMS  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.reflect.Method extractToStringMethod​(java.lang.Class clazz)
      Encapsulation of getting hold of a class's toString method.
      static boolean overridesToString​(java.lang.Class clazz)
      Determine if the given class defines a Object.toString() override.
      • Methods inherited from class java.lang.Object

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

      • NO_PARAM_SIGNATURE

        public static final java.lang.Class[] NO_PARAM_SIGNATURE
      • NO_PARAMS

        public static final java.lang.Object[] NO_PARAMS
    • Method Detail

      • extractToStringMethod

        public static java.lang.reflect.Method extractToStringMethod​(java.lang.Class clazz)
                                                              throws java.lang.NoSuchMethodException
        Encapsulation of getting hold of a class's toString method.
        Parameters:
        clazz - The class from which to extract the toString method.
        Returns:
        The toString method reference
        Throws:
        java.lang.NoSuchMethodException - Should indicate an attempt to extract toString method from interface.
      • overridesToString

        public static boolean overridesToString​(java.lang.Class clazz)
        Determine if the given class defines a Object.toString() override.
        Parameters:
        clazz - The class to check
        Returns:
        True if clazz defines an toString override.