Class BusAddress
java.lang.Object
org.freedesktop.dbus.connections.BusAddress
Defines an address to connect to DBus.
The address will define which transport to use.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddParameter(String _parameter, String _value) Add a parameter to the address.Returns the transport type in uppercase.getGuid()Creates a listening BusAddress if this instance is not already listening.getParameterValue(String _parameter) Returns a the value of the given parameter.getParameterValue(String _parameter, String _default) Returns a the value of the given parameter.getType()Returns the transport type as found in the address.booleanhasParameter(String _parameter) Checks if the given parameter is present.booleanChecks if thisBusAddressis for the given bus type.
The given type will be compared case-insensitive.booleanTrue if this is a listening address.booleanisServer()True if this address represents a listening server address.static BusAddressCreates a newBusAddressfrom String.static BusAddressof(BusAddress _address) Creates a copy of the givenBusAddress.removeParameter(String _parameter) Remove parameter with given name.final StringtoString()
-
Constructor Details
-
BusAddress
-
-
Method Details
-
of
Creates a copy of the givenBusAddress. If given address is null, an emptyBusAddressobject is created.- Parameters:
_address- address to copy- Returns:
- BusAddress
- Since:
- 4.2.0 - 2022-07-18
-
of
Creates a newBusAddressfrom String.- Parameters:
_address- address String, never null or empty- Returns:
- BusAddress
- Since:
- 4.2.0 - 2022-07-18
-
getType
-
getBusType
-
isBusType
Checks if thisBusAddressis for the given bus type.
The given type will be compared case-insensitive.
e.g.isBusType("unix");- Parameters:
_type- to compare- Returns:
- true if same type (case-insensitive), false if null or not same type
- Since:
- 4.2.0 - 2022-07-20
-
isListeningSocket
public boolean isListeningSocket()True if this is a listening address.- Returns:
- true if listening
-
getGuid
-
toString
-
isServer
public boolean isServer()True if this address represents a listening server address.- Returns:
- true if server
-
addParameter
Add a parameter to the address. Adding multiple parameters with same name is not possible and will overwrite previous values.- Parameters:
_parameter- parameter name_value- value- Returns:
- this
- Since:
- 4.2.0 - 2022-07-18
-
removeParameter
Remove parameter with given name. If parameter does not exists, nothing will happen.- Parameters:
_parameter- parameter to remove- Returns:
- this
- Since:
- 4.2.0 - 2022-07-18
-
hasParameter
Checks if the given parameter is present.- Parameters:
_parameter- parameter to check- Returns:
- true if parameter exists, false otherwise
- Since:
- 4.2.2 - 2023-01-11
-
getParameterValue
-
getParameterValue
Returns a the value of the given parameter.When no value present, the given default is returned.
- Parameters:
_parameter- parameter to get value for_default- default to return if parameter not set- Returns:
- String or default
- Since:
- 4.2.2 - 2023-01-11
-
getListenerAddress
Creates a listening BusAddress if this instance is not already listening.- Returns:
- new BusAddress or this
- Since:
- 4.2.0 - 2022-07-18
-