Class StringType

java.lang.Object
org.openhab.core.library.types.StringType
All Implemented Interfaces:
Command, PrimitiveType, State, Type

@NonNullByDefault public class StringType extends Object implements PrimitiveType, State, Command
Author:
Kai Kreuzer - Initial contribution
  • Field Details

  • Constructor Details

    • StringType

      public StringType()
    • StringType

      public StringType(@Nullable String value)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toFullString

      public String toFullString()
      Description copied from interface: Type
      Get a string representation that contains the whole internal representation of the type.

      The returned string could be consumed by the static 'valueOf(String)' method of the respective type to build a new type that is equal to this type.

      Specified by:
      toFullString in interface Type
      Returns:
      a full string representation of the type to be consumed by 'valueOf(String)'
    • valueOf

      public static StringType valueOf(@Nullable String value)
    • format

      public String format(String pattern)
      Description copied from interface: Type
      Formats the value of this type according to a pattern (see Formatter).
      Specified by:
      format in interface Type
      Parameters:
      pattern - the pattern to use
      Returns:
      the formatted string
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object