Class DBusObjectPath

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

public final class DBusObjectPath extends Object implements DBusBasicType
D-Bus objects are identified within an application via their object path. The object path intentionally looks just like a standard Unix file system path. The primary difference is that the path may contain only numbers, letters, underscores, and the / character.

From a functional standpoint, the primary purpose of object paths is simply to be a unique identifier for an object. The "hierarchy" implied the path structure is almost purely conventional. Applications with a naturally hierarchical structure will likely take advantage of this feature while others may choose to ignore it completely.

See Also:
  • Method Details

    • valueOf

      public static DBusObjectPath valueOf(CharSequence sequence) throws ObjectPathException
      Constructs a new DBusObjectPath instance by parsing a CharSequence. Validates that the path is valid UTF-8, follows D-Bus object path syntax, and is within size limits.
      Parameters:
      sequence - The sequence composed of a valid object path.
      Returns:
      A new instance of DBusObjectPath.
      Throws:
      ObjectPathException - If the given CharSequence is not well formed.
    • getWrappedValue

      public CharSequence getWrappedValue()
      Gets the wrapped string value of this object path.
      Returns:
      a string value
    • 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
    • startsWith

      public boolean startsWith(DBusObjectPath prefix)
      Tests if this path start with the specified prefix.
      Parameters:
      prefix - the prefix
      Returns:
      true if the object path represented by the argument is a prefix; false otherwise.
    • endsWith

      public boolean endsWith(DBusObjectPath suffix)
      Tests if this path ends with the specified suffix.
      Parameters:
      suffix - the suffix
      Returns:
      true if the object path represented by the argument is a suffix; false otherwise.
    • 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