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 TypeMethodDescriptionboolean
endsWith
(DBusObjectPath suffix) Tests if this path ends with the specified suffix.boolean
Gets the wrapped value of this basic type.getType()
Gets the type of this implementation.Gets the wrapped string value of this object path.int
hashCode()
boolean
startsWith
(DBusObjectPath prefix) Tests if this path start with the specified prefix.toString()
static DBusObjectPath
valueOf
(CharSequence sequence) Constructs a newDBusObjectPath
instance by parsing aCharSequence
.
-
Method Details
-
valueOf
Constructs a newDBusObjectPath
instance 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 givenCharSequence
is 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:
true
if the object path represented by the argument is a prefix;false
otherwise.
-
endsWith
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
Description copied from interface:DBusType
Gets the type of this implementation. -
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 aDBusBoolean
, the returned object will be aBoolean
.- Specified by:
getDelegate
in interfaceDBusBasicType
- Returns:
- an
Object
-