$darkmode
Elektra 0.11.0
|
Key represents a native Elektra key providing access to its name, value and meta information. More...
Classes | |
enum | CreateArgumentTag |
Argument tags for use with create(String, Object...). More... | |
Public Member Functions | |
byte[] | getBinary () |
Key | setBoolean (boolean value) |
Sets the key's value by converting. More... | |
Key | setByte (byte value) |
Sets the key's value by converting. More... | |
Key | setShort (short value) |
Sets the key's value by converting. More... | |
Key | setInt (int value) |
Sets the key's value by converting. More... | |
Key | setLong (long value) |
Sets the key's value by converting. More... | |
Key | setFloat (float value) |
Sets the key's value by converting. More... | |
Key | setDouble (double value) |
Sets the key's value by converting. More... | |
Key | setString (String value) |
Sets the key's value. More... | |
Key | setBinary (byte[] value) |
Sets the key's binary value. More... | |
Key | setNull () |
Removes the key's value without changing the type. More... | |
Key | setError (ErrorCode code, String reason) |
Sets proper error meta for key. More... | |
Key | addWarning (ErrorCode code, String reason) |
Adds warning meta for key. More... | |
Key | copy (Key source, int flags) |
Copies the information from the. More... | |
boolean | copyMeta (Key source, String metaName) |
Copies some meta information from a. More... | |
boolean | copyAllMeta (Key source) |
Copies all meta information from a. More... | |
Optional< ReadableKey > | getMeta (String metaName) |
Getter for meta information. More... | |
Key | setMeta (String metaName, String newMetaString) |
Sets meta information. More... | |
Key | removeMeta (String metaName) |
Removes meta information. More... | |
KeySet | meta () |
Get KeySet with metakeys. More... | |
Key | setName (String name) |
Sets the key's name. More... | |
Key | setBaseName (String baseName) throws KeyNameException |
Sets the key's base name; will replace current base name with new base name. More... | |
Key | addBaseName (String baseName) |
Adds key base name; will add given base name to current key so that new key is sub key of current key. More... | |
Iterator< ReadableKey > | iterator () |
Public Member Functions inherited from org.libelektra.ReadableKey | |
String | toString () |
Iterator< String > | keyNameIterator () |
boolean | getBoolean () |
byte | getByte () |
short | getShort () |
int | getInt () |
long | getLong () |
float | getFloat () |
double | getDouble () |
String | getString () |
Key | dup () |
Duplicates this ReadableKey as Key. More... | |
Key | dup (int flags) |
Duplicates this ReadableKey as Key. More... | |
int | compareTo (ReadableKey other) |
Compares this key with the. More... | |
boolean | isBelow (ReadableKey other) |
Checks whether this key is sub-key of the. More... | |
boolean | isBelowOrSame (ReadableKey other) |
Checks whether this key is the same as the. More... | |
boolean | isDirectlyBelow (ReadableKey other) |
Checks whether this key is direct sub-key of the. More... | |
boolean | isBinary () |
boolean | isString () |
String | getName () |
int | getNameSize () |
String | getBaseName () |
int | getBaseNameSize () |
int | getValueSize () |
boolean | isNull () |
Static Public Member Functions | |
static Key | create () |
Constructs a temporary nameless Key which cannot be saved to the key data base but used for transferring warnings and error information. More... | |
static Key | create (String name, @Nullable Object value, Key... meta) |
Constructs a new Key with the specified content and arguments More... | |
static Key | create (String name, Key... meta) |
Basic constructor of key class. More... | |
Protected Member Functions | |
Key (long nativePointer, boolean suppressCleanUp) | |
Constructor associating a new Key instance with a native pointer in long format Suppressing clean-up has been introduced for usage of this binding as JNI plug-in and should normally not be used in any other case. More... | |
Key (Pointer pointer) | |
Constructor associating a new Key instance with a JNA pointer. More... | |
void | release () |
Clean-up method to release key reference by first decrementing its reference counter and then trying to free the native reference keys, will get cleaned up by garbage collection as soon as they get phantom reachable. | |
Protected Member Functions inherited from org.libelektra.ReadableKey | |
ReadableKey (Pointer pointer) | |
Constructor associating a new ReadableKey instance with a JNA pointer. More... | |
ReadableKey (Pointer pointer, boolean suppressCleanUp) | |
Constructor associating a new ReadableKey instance with a JNA pointer Suppressing clean-up has been introduced for usage of this binding as JNI plug-in and should normally not be used in any other case. More... | |
Pointer | getPointer () |
Static Protected Member Functions | |
static Optional< Key > | create (@Nullable Pointer pointer) |
Constructs a new Key instance associated with a JNA pointer. More... | |
static Key | create (String name, Object... args) |
Constructs a new Key with the specified content and arguments More... | |
Static Protected Member Functions inherited from org.libelektra.ReadableKey | |
static Optional< ReadableKey > | createReadOnly (@Nullable Pointer pointer) |
Constructs a new ReadableKey instance associated with a JNA pointer. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from org.libelektra.ReadableKey | |
static final int | KEY_CP_NAME = 1 << 0 |
Flag for use with Key#copy(Key, int) and dup(int) for copying the key name. | |
static final int | KEY_CP_STRING = 1 << 1 |
Flag for use with Key#copy(Key, int) and dup(int) for copying the key value, if it is a string. More... | |
static final int | KEY_CP_VALUE = 1 << 2 |
Flag for use with Key#copy(Key, int) and dup(int) for copying the key value. More... | |
static final int | KEY_CP_META = 1 << 3 |
Flag for use with Key#copy(Key, int) and dup(int) for copying the key metadata. | |
static final int | KEY_CP_ALL = KEY_CP_NAME | KEY_CP_VALUE | KEY_CP_META |
Flag for use with Key#copy(Key, int) and dup(int) for copying the key name, value and metadata. | |
Key represents a native Elektra key providing access to its name, value and meta information.
|
inlineprotected |
Constructor associating a new Key instance with a native pointer in long format
Suppressing clean-up has been introduced for usage of this binding as JNI plug-in and should normally not be used in any other case.
nativePointer | Native pointer to key in long format |
suppressCleanUp | True to suppress native reference clean-up as soon as this Key instance becomes phantom reachable, false otherwise @implNote Increased the native key's reference counter, even if suppressCleanUp
true
|
|
inlineprotected |
|
inline |
Adds key base name; will add given base name to current key so that new key is sub key of current key.
baseName | New key base name to add |
|
inline |
Copies the information from the.
key into this key.
source | Source Key object containing the information to copy |
flags | Flags indicating which parts of the key to copy Example: KEY_CP_NAME | KEY_CP_VALUE |
KeyException | if copying failed |
IllegalStateException | if this or the source
|
IllegalArgumentException | if source
null
|
|
inline |
Copies all meta information from a.
key to this key
source | Key used as source |
KeyMetaException | if copying failed |
IllegalStateException | if this or the source
|
IllegalArgumentException | if source
null
|
|
inline |
Copies some meta information from a.
key to this key
KeyMetaException | if this key's meta information is read-only of copying failed |
IllegalStateException | if this or the source
|
IllegalArgumentException | if source
null
metaName
|
|
inlinestatic |
Constructs a temporary nameless Key which cannot be saved to the key data base but used for transferring warnings and error information.
KeyException | on allocation problems |
|
inlinestaticprotected |
Constructs a new Key instance associated with a JNA pointer.
pointer | Optional JNA Pointer to key |
|
inlinestatic |
Constructs a new Key with the specified content and arguments
name | Name of the key (first part of key-value pair) |
value | Optional Value of key. will be determine from the object by calling {}. To set a binary value, please see #setBinary(byte[])}. meta Metadata that should be added to this key, null keys will be filtered away New key KeyException if the key name is invalid or there have been allocation problems |
|
inlinestatic |
Basic constructor of key class.
name | Key name; first part of key-value pair |
meta | Metadata that should be added to this key. Will filter null values. |
KeyException | if the key name is invalid or there have been allocation problems |
|
inlinestaticprotected |
Constructs a new Key with the specified content and arguments
name | Key name; first part of key-value pair |
args | Arguments used for key value Example: CreateArgumentTag#KEY_VALUE, "custom key value", CreateArgumentTag#KEY_END |
KeyException | if the key name is invalid or there have been allocation problems |
|
inline |
KeyBinaryValueException | if the underlying native key is not of type binary |
IllegalStateException | if this Key has already been released |
|
inline |
Getter for meta information.
metaName | Key name of meta information to be fetched |
|
inline |
|
inline |
|
inline |
|
inline |
Sets the key's base name; will replace current base name with new base name.
baseName | New key base name to use |
KeyNameException | if baseName
|
IllegalStateException | if this Key has already been released |
IllegalArgumentException | if baseName
null
|
|
inline |
|
inline |
Sets the key's value by converting.
to string
value | Value to set |
IllegalStateException | if this Key has already been released |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Sets the key's name.
name | New key name to use |
|
inline |
|
inline |
|
inline |