Class ObjectUtils

java.lang.Object
io.openems.common.utils.ObjectUtils

public class ObjectUtils extends Object
  • Constructor Details

    • ObjectUtils

      public ObjectUtils()
  • Method Details

    • getAsString

      public static String getAsString(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 Optional<String> getAsOptionalString(Object object)
      Gets the given Object as a Optional String.
      Parameters:
      object - to get as Optional
      Returns:
      the Optional String value
    • getAsInteger

      public static Integer getAsInteger(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 Object[] getAsObjectArrray(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