Package de.espirit.firstspirit.json
Interface JsonPair
- All Superinterfaces:
Comparable<JsonPair>
,JsonElement<JsonElement<?>>
,de.espirit.firstspirit.json.JsonOutput
@NonExtendable
@Experimental
public interface JsonPair
extends JsonElement<JsonElement<?>>, Comparable<JsonPair>
An interface for representing a json key/value pair containing of a key and a
JsonElement
.
A JsonPair can be part of a JsonObject
.
CAUTION:
This class is still in development and may change drastically without any further notice.- Since:
- 5.2.191206
- See Also:
-
JsonOutput
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
getKey()
This method returns the current key of the pair.@NotNull JsonElement<?>
getValue()
This method returns the current value of the pair.static @NotNull JsonPair
of
(@NotNull String key, @NotNull JsonElement<?> value) Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface de.espirit.firstspirit.json.JsonOutput
json, writeTo
-
Method Details
-
of
@NotNull static @NotNull JsonPair of(@NotNull @NotNull String key, @NotNull @NotNull JsonElement<?> value) -
getKey
This method returns the current key of the pair.- Returns:
- The key of the pair.
- Since:
- 5.2.191206
-
getValue
This method returns the current value of the pair.- Specified by:
getValue
in interfaceJsonElement<JsonElement<?>>
- Returns:
- The value of the pair.
- Since:
- 5.2.191206
-