Package dev.qixils.crowdcontrol.socket
Interface JsonObject
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> T
fromInputStream(@NotNull InputStream input, @NotNull Function<@NotNull String,@Nullable T> jsonMapper)
Obtains a JSON object from an input stream of 0x00-terminated json strings.@NotNull String
toJSON()
Converts this object to its JSON representation.
-
-
-
Method Detail
-
fromInputStream
@Nullable @CheckReturnValue @Internal @AvailableSince("3.3.0") static <T> T fromInputStream(@NotNull @NotNull InputStream input, @NotNull @NotNull Function<@NotNull String,@Nullable T> jsonMapper) throws IOException
Obtains a JSON object from an input stream of 0x00-terminated json strings.- Type Parameters:
T
- the type of the POJO- Parameters:
input
- an input streamjsonMapper
- a function that maps a JSON string to a POJO- Returns:
- the parsed POJO
- Throws:
IOException
- if an I/O error occurs in the input stream- Since:
- 3.3.0
-
toJSON
@NotNull @CheckReturnValue @AvailableSince("3.3.0") @NotNull String toJSON()
Converts this object to its JSON representation.- Returns:
- JSON string
- Since:
- 3.3.0
-
-