Package com.lucimber.dbus.type
Class DBusSignature
java.lang.Object
com.lucimber.dbus.type.DBusSignature
- All Implemented Interfaces:
DBusBasicType,DBusType
D-Bus uses a string-based type encoding mechanism called Signatures to describe the number and
types of arguments required by methods and signals. Signatures are used for interface
declaration/documentation, data marshalling, and validity checking. Their string encoding uses a
simple, though expressive, format and a basic understanding of it is required for effective D-Bus
use.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanGets a list of signatures that are a subset of this signature.Gets the wrapped value of this basic type.intGets the number of single complete types of which this signature consists of.getType()Gets the type of this implementation.inthashCode()booleanisArray()ReturnsTRUE, if this signature describes an array andFALSEotherwise.booleanReturnsTRUE, if this signature describes a container andFALSEotherwise.booleanReturnsTRUE, if this signature describes a dictionary andFALSEotherwise.booleanReturnsTRUE, if this signature describes a dictionary-entry andFALSEotherwise.booleanisStruct()ReturnsTRUE, if this signature describes a struct andFALSEotherwise.booleanReturnsTRUE, if this signature describes a variant andFALSEotherwise.Returns a new signature without the enclosing container description.toString()static DBusSignaturevalueOf(CharSequence sequence) Constructs a newDBusSignatureinstance by parsing aCharSequence.
-
Method Details
-
valueOf
Constructs a newDBusSignatureinstance by parsing aCharSequence.- Parameters:
sequence- The sequence composed of one or multiple single complete types.- Returns:
- A new instance of
DBusSignature. - Throws:
SignatureException- If the givenCharSequenceis not well-formed.
-
getChildren
Gets a list of signatures that are a subset of this signature. Each signature describes a single complete type.- Returns:
- a
ListofDBusSignatures
-
getQuantity
public int getQuantity()Gets the number of single complete types of which this signature consists of.- Returns:
- an
Integer
-
toString
-
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
-
equals
-
hashCode
public int hashCode() -
isDictionary
public boolean isDictionary()ReturnsTRUE, if this signature describes a dictionary andFALSEotherwise. A dictionary is an array of dict-entries.- Returns:
- a
Boolean
-
isArray
public boolean isArray()ReturnsTRUE, if this signature describes an array andFALSEotherwise.- Returns:
- a
Boolean
-
isDictionaryEntry
public boolean isDictionaryEntry()ReturnsTRUE, if this signature describes a dictionary-entry andFALSEotherwise. A dictionary-entry is a key-value pair.- Returns:
- a
Boolean
-
isStruct
public boolean isStruct()ReturnsTRUE, if this signature describes a struct andFALSEotherwise.- Returns:
- a
Boolean
-
isVariant
public boolean isVariant()ReturnsTRUE, if this signature describes a variant andFALSEotherwise.- Returns:
- a
Boolean
-
subContainer
Returns a new signature without the enclosing container description. The signature must describe an array, a dict-entry or a struct type.- Returns:
- a
DBusSignature - Throws:
IllegalArgumentException- If the signature does not describe an array, a dict-entry or a struct type.
-
isContainerType
public boolean isContainerType()ReturnsTRUE, if this signature describes a container andFALSEotherwise. A container can be an ARRAY, a DICT-ENTRY, a STRUCT or a VARIANT.- Returns:
- a
Boolean - Throws:
IllegalArgumentException- If this signature consists of more than one single complete type.
-