Class DBusString

java.lang.Object
com.lucimber.dbus.type.DBusString
All Implemented Interfaces:
DBusBasicType, DBusType

public final class DBusString extends Object implements DBusBasicType
Maps a String to its D-Bus equivalent of STRING.
  • Method Details

    • valueOf

      public static DBusString valueOf(String value)
      Constructs a new D-Bus string from its Java counterpart. Validates that the string is valid UTF-8 and within size limits.
      Parameters:
      value - the string value
      Returns:
      a new instance
      Throws:
      IllegalArgumentException - if the string is invalid
    • getType

      public Type getType()
      Description copied from interface: DBusType
      Gets the type of this implementation.
      Specified by:
      getType in interface DBusType
      Returns:
      a Type
    • getDelegate

      public String getDelegate()
      Description copied from interface: DBusBasicType
      Gets the wrapped value of this basic type. The D-Bus type system is made of ASCII characters representing the value's type. Each D-Bus data type is mapped in this framework by its corresponding class. This method enables the access to the Java's data type - the delegate. If this basic type is for example a DBusBoolean, the returned object will be a Boolean.
      Specified by:
      getDelegate in interface DBusBasicType
      Returns:
      an Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object