Package io.github.jwharm.javagi.gobject
Class ValueUtil
java.lang.Object
io.github.jwharm.javagi.gobject.ValueUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
objectToValue
(Object src, 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 Object
valueToObject
(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.
-