Package com.lucimber.dbus.type
Class DBusObjectPath
java.lang.Object
com.lucimber.dbus.type.DBusObjectPath
- All Implemented Interfaces:
DBusBasicType,DBusType
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 Summary
Modifier and TypeMethodDescriptionbooleanendsWith(DBusObjectPath suffix) Tests if this path ends with the specified suffix.booleanGets the wrapped value of this basic type.getType()Gets the type of this implementation.Gets the wrapped string value of this object path.inthashCode()booleanstartsWith(DBusObjectPath prefix) Tests if this path start with the specified prefix.toString()static DBusObjectPathvalueOf(CharSequence sequence) Constructs a newDBusObjectPathinstance by parsing aCharSequence.
-
Method Details
-
valueOf
Constructs a newDBusObjectPathinstance by parsing aCharSequence. 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 givenCharSequenceis not well formed.
-
getWrappedValue
Gets the wrapped string value of this object path.- Returns:
- a string value
-
equals
-
hashCode
public int hashCode() -
toString
-
startsWith
Tests if this path start with the specified prefix.- Parameters:
prefix- the prefix- Returns:
trueif the object path represented by the argument is a prefix;falseotherwise.
-
endsWith
Tests if this path ends with the specified suffix.- Parameters:
suffix- the suffix- Returns:
trueif the object path represented by the argument is a suffix;falseotherwise.
-
getType
Description copied from interface:DBusTypeGets the type of this implementation. -
getDelegate
Description copied from interface:DBusBasicTypeGets 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 aDBusBoolean, the returned object will be aBoolean.- Specified by:
getDelegatein interfaceDBusBasicType- Returns:
- an
Object
-