Class Variant<T>

java.lang.Object
org.freedesktop.dbus.Variant<T>

public class Variant<T> extends Object
A Wrapper class for Variant values. A method on DBus can send or receive a Variant. This will wrap another value whose type is determined at runtime. The Variant may be parameterized to restrict the types it may accept.
  • Constructor Details

    • Variant

      public Variant(T o) throws IllegalArgumentException
      Create a Variant from a basic type object.
      Parameters:
      o - The wrapped value.
    • Variant

      public Variant(T o, Type type) throws IllegalArgumentException
      Create a Variant.
      Parameters:
      o - The wrapped value.
      type - The explicit type of the value.
    • Variant

      public Variant(T o, String sig) throws IllegalArgumentException
      Create a Variant.
      Parameters:
      o - The wrapped value.
      sig - The explicit type of the value, as a dbus type string.
  • Method Details

    • getValue

      public T getValue()
      Return the wrapped value.
    • getType

      public Type getType()
      Return the type of the wrapped value.
    • getSig

      public String getSig()
      Return the dbus signature of the wrapped value.
    • toString

      public String toString()
      Format the Variant as a string.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Compare this Variant with another by comparing contents
      Overrides:
      equals in class Object