Class ObjectUtils


  • public class ObjectUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Integer getAsInteger​(java.lang.Object object)
      Cast and return the given Object as a Integer.
      static java.lang.Object[] getAsObjectArrray​(java.lang.Object object)
      Cast and return the given Object as a Object array.
      static java.util.Optional<java.lang.String> getAsOptionalString​(java.lang.Object object)
      Gets the given Object as a Optional String.
      static java.lang.String getAsString​(java.lang.Object object)
      Cast and return the given Object as a String.
      • Methods inherited from class java.lang.Object

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

      • ObjectUtils

        public ObjectUtils()
    • Method Detail

      • getAsString

        public static java.lang.String getAsString​(java.lang.Object object)
        Cast and return the given Object as a String. If given object is no String it will return null.
        Parameters:
        object - to cast an return as String
        Returns:
        a String or null
      • getAsOptionalString

        public static java.util.Optional<java.lang.String> getAsOptionalString​(java.lang.Object object)
        Gets the given Object as a Optional String.
        Parameters:
        object - to get as Optional
        Returns:
        the Optional String value
      • getAsInteger

        public static java.lang.Integer getAsInteger​(java.lang.Object object)
        Cast and return the given Object as a Integer. If given object is no Integer it will return null.
        Parameters:
        object - to cast an return as Integer
        Returns:
        a Integer or null
      • getAsObjectArrray

        public static java.lang.Object[] getAsObjectArrray​(java.lang.Object object)
        Cast and return the given Object as a Object array. If given object is no Object array it will return an empty array.
        Parameters:
        object - to cast an return as Object array
        Returns:
        a Object array or empty array