Package jodd.util

Class Util


  • public class Util
    extends java.lang.Object
    Some general utilities. All methods are safe as possible and operates with as many types as possible.
    • Constructor Summary

      Constructors 
      Constructor Description
      Util()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean containsElement​(java.lang.Object obj, java.lang.Object element)
      Returns true if first argument contains provided element.
      static int length​(java.lang.Object obj)
      Returns length of the object.
      static java.lang.String toPrettyString​(java.lang.Object value)
      Converts object into pretty string.
      static java.lang.String toString​(java.lang.Object value)
      Returns string representation of an object, while checking for null.
      • Methods inherited from class java.lang.Object

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

      • Util

        public Util()
    • Method Detail

      • toString

        public static java.lang.String toString​(java.lang.Object value)
        Returns string representation of an object, while checking for null.
      • length

        public static int length​(java.lang.Object obj)
        Returns length of the object. Returns 0 for null. Returns -1 for objects without a length.
      • containsElement

        public static boolean containsElement​(java.lang.Object obj,
                                              java.lang.Object element)
        Returns true if first argument contains provided element. It works for strings, collections, maps and arrays. s
      • toPrettyString

        public static java.lang.String toPrettyString​(java.lang.Object value)
        Converts object into pretty string. All arrays are iterated.