Klasse BusAddress

java.lang.Object
org.freedesktop.dbus.connections.BusAddress

public class BusAddress extends Object
Defines an address to connect to DBus. The address will define which transport to use.
  • Konstruktordetails

    • BusAddress

      protected BusAddress(BusAddress _obj)
  • Methodendetails

    • of

      public static BusAddress of(BusAddress _address)
      Creates a copy of the given BusAddress. If given address is null, an empty BusAddress object is created.
      Parameter:
      _address - address to copy
      Gibt zurück:
      BusAddress
      Seit:
      4.2.0 - 2022-07-18
    • of

      public static BusAddress of(String _address)
      Creates a new BusAddress from String.
      Parameter:
      _address - address String, never null or empty
      Gibt zurück:
      BusAddress
      Seit:
      4.2.0 - 2022-07-18
    • getType

      public String getType()
      Returns the transport type as found in the address.
      Gibt zurück:
      type
    • getBusType

      public String getBusType()
      Returns the transport type in uppercase.
      Gibt zurück:
      type
    • isBusType

      public boolean isBusType(String _type)
      Checks if this BusAddress is for the given bus type.
      The given type will be compared case-insensitive.
      e.g.
       isBusType("unix");
       
      Parameter:
      _type - to compare
      Gibt zurück:
      true if same type (case-insensitive), false if null or not same type
      Seit:
      4.2.0 - 2022-07-20
    • isListeningSocket

      public boolean isListeningSocket()
      True if this is a listening address.
      Gibt zurück:
      true if listening
    • getGuid

      public String getGuid()
    • toString

      public final String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • isServer

      public boolean isServer()
      True if this address represents a listening server address.
      Gibt zurück:
      true if server
    • addParameter

      public BusAddress addParameter(String _parameter, String _value)
      Add a parameter to the address. Adding multiple parameters with same name is not possible and will overwrite previous values.
      Parameter:
      _parameter - parameter name
      _value - value
      Gibt zurück:
      this
      Seit:
      4.2.0 - 2022-07-18
    • removeParameter

      public BusAddress removeParameter(String _parameter)
      Remove parameter with given name. If parameter does not exists, nothing will happen.
      Parameter:
      _parameter - parameter to remove
      Gibt zurück:
      this
      Seit:
      4.2.0 - 2022-07-18
    • hasParameter

      public boolean hasParameter(String _parameter)
      Checks if the given parameter is present.
      Parameter:
      _parameter - parameter to check
      Gibt zurück:
      true if parameter exists, false otherwise
      Seit:
      4.2.2 - 2023-01-11
    • getParameterValue

      public String getParameterValue(String _parameter)
      Returns a the value of the given parameter.

      When no value present, null is returned.

      Parameter:
      _parameter - parameter to get value for
      Gibt zurück:
      String or null
      Seit:
      4.2.0 - 2022-07-19
    • getParameterValue

      public String getParameterValue(String _parameter, String _default)
      Returns a the value of the given parameter.

      When no value present, the given default is returned.

      Parameter:
      _parameter - parameter to get value for
      _default - default to return if parameter not set
      Gibt zurück:
      String or default
      Seit:
      4.2.2 - 2023-01-11
    • getListenerAddress

      public BusAddress getListenerAddress()
      Creates a listening BusAddress if this instance is not already listening.
      Gibt zurück:
      new BusAddress or this
      Seit:
      4.2.0 - 2022-07-18