Package org.javagi.gobject
Class ValueUtil
java.lang.Object
org.javagi.gobject.ValueUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Value
Allocate and initialize a new GValue, and copysrc
into it.static boolean
objectToValue
(@Nullable Object src, @Nullable Value dest) Read the GType of thedest
GValue and set thesrc
object (or boxed primitive value) as its value using the corresponding setter in theValue
proxy class.static @Nullable Object
valueToObject
(@Nullable Value src) Read the GType from the GValue, call the corresponding getter (using the methods defined in theValue
proxy class), and return the result.
-
Constructor Details
-
ValueUtil
public ValueUtil()
-
-
Method Details
-
valueToObject
Read the GType from the GValue, call the corresponding getter (using the methods defined in theValue
proxy class), and return the result.- Parameters:
src
- a GValue instance.- Returns:
- a Java object (or boxed primitive value) that has been
marshaled from the GValue, or
null
ifsrc
is null.
-
objectToValue
Read the GType of thedest
GValue and set thesrc
object (or boxed primitive value) as its value using the corresponding setter in theValue
proxy class.- Parameters:
src
- the Java Object (or boxed primitive value) to put in the GValue. Should not benull
dest
- the GValue to write to. Should not benull
- Returns:
true
if the value was set, andfalse
otherwise.
-
copy
-