Package org.gnome.glib
Class LogField
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.glib.LogField
- All Implemented Interfaces:
Proxy
Structure representing a single field in a structured log entry. See
g_log_structured() for details.
Log fields may contain arbitrary values, including binary with embedded nul
bytes. If the field contains a string, the string must be UTF-8 encoded and
have a trailing nul byte. Otherwise, length must be set to a non-negative
value.
- Since:
- 2.50
-
Constructor Summary
ConstructorsConstructorDescriptionLogField()Allocate a new LogField.Allocate a new LogField.LogField(MemorySegment address) Create a LogField proxy instance for the provided memory address.LogField(String key, MemorySegment value, long length) Allocate a new LogField with the fields set to the provided values.LogField(String key, MemorySegment value, long length, Arena arena) Allocate a new LogField with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayoutThe memory layout of the native struct.readKey()Read the value of the fieldkey.longRead the value of the fieldlength.Read the value of the fieldvalue.voidWrite a value in the fieldkey.voidwriteLength(long length) Write a value in the fieldlength.voidwriteValue(MemorySegment value) Write a value in the fieldvalue.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
LogField
Create a LogField proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
LogField
Allocate a new LogField.- Parameters:
arena- to control the memory allocation scope
-
LogField
public LogField()Allocate a new LogField. The memory is allocated withArena.ofAuto(). -
LogField
Allocate a new LogField with the fields set to the provided values.- Parameters:
key- value for the fieldkeyvalue- value for the fieldvaluelength- value for the fieldlengtharena- to control the memory allocation scope
-
LogField
Allocate a new LogField with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
key- value for the fieldkeyvalue- value for the fieldvaluelength- value for the fieldlength
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readKey
-
writeKey
-
readValue
Read the value of the fieldvalue.- Returns:
- The value of the field
value
-
writeValue
Write a value in the fieldvalue.- Parameters:
value- The new value for the fieldvalue
-
readLength
public long readLength()Read the value of the fieldlength.- Returns:
- The value of the field
length
-
writeLength
public void writeLength(long length) Write a value in the fieldlength.- Parameters:
length- The new value for the fieldlength
-