keycloak-federation
公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.freedesktop.dbus.Variant< T > クラステンプレート
org.freedesktop.dbus.Variant< T > 連携図
Collaboration graph

公開メンバ関数

 Variant (T o) throws IllegalArgumentException
 
 Variant (T o, Type type) throws IllegalArgumentException
 
 Variant (T o, String sig) throws IllegalArgumentException
 
getValue ()
 
Type getType ()
 
String getSig ()
 
String toString ()
 
boolean equals (Object other)
 

非公開変数類

final T o
 
final Type type
 
final String sig
 

詳解

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.

構築子と解体子

◆ Variant() [1/3]

org.freedesktop.dbus.Variant< T >.Variant ( o) throws IllegalArgumentException
inline

Create a Variant from a basic type object.

引数
oThe wrapped value.
例外
IllegalArugmentExceptionIf you try and wrap Null or an object of a non-basic type.
39  {
40  if (null == o) throw new IllegalArgumentException(getString("cannotWrapNullInVariant"));
41  type = o.getClass();
42  try {
43  String[] ss = Marshalling.getDBusType(o.getClass(), true);
44  if (ss.length != 1)
45  throw new IllegalArgumentException(getString("cannotWrapMultiValuedInVariant") + type);
46  this.sig = ss[0];
47  } catch (DBusException DBe) {
48  if (AbstractConnection.EXCEPTION_DEBUG && Debug.debug) Debug.print(Debug.ERR, DBe);
49  throw new IllegalArgumentException(MessageFormat.format(getString("cannotWrapUnqualifiedVariant"), new Object[]{o.getClass(), DBe.getMessage()}));
50  }
51  this.o = o;
52  }
final T o
Definition: Variant.java:29
final Type type
Definition: Variant.java:30
final String sig
Definition: Variant.java:31

◆ Variant() [2/3]

org.freedesktop.dbus.Variant< T >.Variant ( o,
Type  type 
) throws IllegalArgumentException
inline

Create a Variant.

引数
oThe wrapped value.
typeThe explicit type of the value.
例外
IllegalArugmentExceptionIf you try and wrap Null or an object which cannot be sent over DBus.
61  {
62  if (null == o) throw new IllegalArgumentException(getString("cannotWrapNullInVariant"));
63  this.type = type;
64  try {
65  String[] ss = Marshalling.getDBusType(type);
66  if (ss.length != 1)
67  throw new IllegalArgumentException(getString("cannotWrapMultiValuedInVariant") + type);
68  this.sig = ss[0];
69  } catch (DBusException DBe) {
70  if (AbstractConnection.EXCEPTION_DEBUG && Debug.debug) Debug.print(Debug.ERR, DBe);
71  throw new IllegalArgumentException(MessageFormat.format(getString("cannotWrapUnqualifiedVariant"), new Object[]{type, DBe.getMessage()}));
72  }
73  this.o = o;
74  }
final T o
Definition: Variant.java:29
final Type type
Definition: Variant.java:30
final String sig
Definition: Variant.java:31

◆ Variant() [3/3]

org.freedesktop.dbus.Variant< T >.Variant ( o,
String  sig 
) throws IllegalArgumentException
inline

Create a Variant.

引数
oThe wrapped value.
sigThe explicit type of the value, as a dbus type string.
例外
IllegalArugmentExceptionIf you try and wrap Null or an object which cannot be sent over DBus.
83  {
84  if (null == o) throw new IllegalArgumentException(getString("cannotWrapNullInVariant"));
85  this.sig = sig;
86  try {
87  Vector<Type> ts = new Vector<Type>();
88  Marshalling.getJavaType(sig, ts, 1);
89  if (ts.size() != 1)
90  throw new IllegalArgumentException(getString("cannotWrapNoTypesInVariant") + sig);
91  this.type = ts.get(0);
92  } catch (DBusException DBe) {
93  if (AbstractConnection.EXCEPTION_DEBUG && Debug.debug) Debug.print(Debug.ERR, DBe);
94  throw new IllegalArgumentException(MessageFormat.format(getString("cannotWrapUnqualifiedVariant"), new Object[]{sig, DBe.getMessage()}));
95  }
96  this.o = o;
97  }
final T o
Definition: Variant.java:29
final Type type
Definition: Variant.java:30
final String sig
Definition: Variant.java:31

関数詳解

◆ equals()

boolean org.freedesktop.dbus.Variant< T >.equals ( Object  other)
inline

Compare this Variant with another by comparing contents

131  {
132  if (null == other) return false;
133  if (!(other instanceof Variant)) return false;
134  return this.o.equals(((Variant<? extends Object>) other).o);
135  }
final T o
Definition: Variant.java:29
Variant(T o)
Definition: Variant.java:39

◆ getSig()

String org.freedesktop.dbus.Variant< T >.getSig ( )
inline

Return the dbus signature of the wrapped value.

116  {
117  return sig;
118  }
final String sig
Definition: Variant.java:31

◆ getType()

Type org.freedesktop.dbus.Variant< T >.getType ( )
inline

Return the type of the wrapped value.

109  {
110  return type;
111  }
final Type type
Definition: Variant.java:30

◆ getValue()

T org.freedesktop.dbus.Variant< T >.getValue ( )
inline

Return the wrapped value.

102  {
103  return o;
104  }
final T o
Definition: Variant.java:29

◆ toString()

String org.freedesktop.dbus.Variant< T >.toString ( )
inline

Format the Variant as a string.

123  {
124  return "[" + o + "]";
125  }
final T o
Definition: Variant.java:29

メンバ詳解

◆ o

final T org.freedesktop.dbus.Variant< T >.o
private

◆ sig

final String org.freedesktop.dbus.Variant< T >.sig
private

◆ type

final Type org.freedesktop.dbus.Variant< T >.type
private

このクラス詳解は次のファイルから抽出されました: