Package org.javagi.glib.types
Class VariantTypes
java.lang.Object
org.javagi.glib.types.VariantTypes
This class contains G_VARIANT_TYPE_... declarations and conversion functions
from Java classes to GVariant types and vice versa.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VariantType
An indefinite type that is a supertype of every type (including itself).static final VariantType
An indefinite type that is a supertype of every array type.static final VariantType
An indefinite type that is a supertype of every basic (ie: non-container) type.static final VariantType
The type of a value that can be eithertrue
orfalse
.static final VariantType
The type of an integer value that can range from 0 to 255.static final VariantType
The type of an array of bytes.static final VariantType
The type of an array of byte strings (an array of arrays of bytes).static final VariantType
An indefinite type that is a supertype of every dictionary entry type.static final VariantType
An indefinite type that is a supertype of every dictionary type -- that is, any array type that has an element type equal to any dictionary entry type.static final VariantType
The type of a double precision IEEE754 floating point number.static final VariantType
The type of a 32bit signed integer value, that by convention, is used as an index into an array of file descriptors that are sent alongside a D-Bus message.static final VariantType
The type of an integer value that can range from -32768 to 32767.static final VariantType
The type of an integer value that can range from -2147483648 to 2147483647.static final VariantType
The type of an integer value that can range from -9223372036854775808 to 9223372036854775807.static final VariantType
An indefinite type that is a supertype of every maybe type.static final VariantType
The type of a D-Bus object reference.static final VariantType
The type of an array of object paths.static final VariantType
The type of a D-Bus type signature.static final VariantType
The type of a string.static final VariantType
The type of an array of strings.static final VariantType
An indefinite type that is a supertype of every tuple type, regardless of the number of items in the tuple.static final VariantType
The type of an integer value that can range from 0 to 65535.static final VariantType
The type of an integer value that can range from 0 to 4294967295.static final VariantType
The type of an integer value that can range from 0 to 18446744073709551615 (inclusive).static final VariantType
The empty tuple type.static final VariantType
The type of a dictionary mapping strings to variants (the ubiquitous"a{sv}"
type).static final VariantType
The type of a box that contains any other value (including another variant). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VariantType
objectToVariantType
(Object object) Return aVariantType
that is suitable for the Java class of this object.static Class
<?> variantToClass
(Variant variant) Return a Java class that is suitable for theVariantType
of this GVariant.
-
Field Details
-
BOOLEAN
The type of a value that can be eithertrue
orfalse
. -
BYTE
The type of an integer value that can range from 0 to 255. -
INT16
The type of an integer value that can range from -32768 to 32767. -
UINT16
The type of an integer value that can range from 0 to 65535. There were about this many people living in Toronto in the 1870s. -
INT32
The type of an integer value that can range from -2147483648 to 2147483647. -
UINT32
The type of an integer value that can range from 0 to 4294967295. That's one number for everyone who was around in the late 1970s. -
INT64
The type of an integer value that can range from -9223372036854775808 to 9223372036854775807. -
UINT64
The type of an integer value that can range from 0 to 18446744073709551615 (inclusive). That's a really big number, but a Rubik's cube can have a bit more than twice as many possible positions. -
DOUBLE
The type of a double precision IEEE754 floating point number. These guys go up to about 1.80e308 (plus and minus) but miss out on some numbers in between. In any case, that's far greater than the estimated number of fundamental particles in the observable universe. -
STRING
The type of a string. "" is a string.null
is not a string. -
OBJECT_PATH
The type of a D-Bus object reference. These are strings of a specific format used to identify objects at a given destination on the bus.If you are not interacting with D-Bus, then there is no reason to make use of this type. If you are, then the D-Bus specification contains a precise description of valid object paths.
-
SIGNATURE
The type of a D-Bus type signature. These are strings of a specific format used as type signatures for D-Bus methods and messages.If you are not interacting with D-Bus, then there is no reason to make use of this type. If you are, then the D-Bus specification contains a precise description of valid signature strings.
-
VARIANT
The type of a box that contains any other value (including another variant). -
HANDLE
The type of a 32bit signed integer value, that by convention, is used as an index into an array of file descriptors that are sent alongside a D-Bus message.If you are not interacting with D-Bus, then there is no reason to make use of this type.
-
UNIT
The empty tuple type. Has only one instance. Known also as "triv" or "void". -
ANY
An indefinite type that is a supertype of every type (including itself). -
BASIC
An indefinite type that is a supertype of every basic (ie: non-container) type. -
MAYBE
An indefinite type that is a supertype of every maybe type. -
ARRAY
An indefinite type that is a supertype of every array type. -
TUPLE
An indefinite type that is a supertype of every tuple type, regardless of the number of items in the tuple. -
DICT_ENTRY
An indefinite type that is a supertype of every dictionary entry type. -
DICTIONARY
An indefinite type that is a supertype of every dictionary type -- that is, any array type that has an element type equal to any dictionary entry type. -
STRING_ARRAY
The type of an array of strings. -
OBJECT_PATH_ARRAY
The type of an array of object paths. -
BYTESTRING
The type of an array of bytes. This type is commonly used to pass around strings that may not be valid utf8. In that case, the convention is that the nul terminator character should be included as the last character in the array. -
BYTESTRING_ARRAY
The type of an array of byte strings (an array of arrays of bytes). -
VARDICT
The type of a dictionary mapping strings to variants (the ubiquitous"a{sv}"
type).- Since:
- 2.30
-
-
Constructor Details
-
VariantTypes
public VariantTypes()
-
-
Method Details
-
objectToVariantType
Return aVariantType
that is suitable for the Java class of this object.- Parameters:
object
- a Java object instance- Returns:
- the VariantType
-
variantToClass
Return a Java class that is suitable for theVariantType
of this GVariant.- Parameters:
variant
- aVariant
instance- Returns:
- the Java class
-