Interface ComponentDecoder<S,O extends Component>
- Type Parameters:
S
- the serialized typeO
- the output component type
- All Known Subinterfaces:
ComponentSerializer<I,
O, R>
public interface ComponentDecoder<S,O extends Component>
A
Component
decoder, which provides deserialization, but without serialization.
For both serialization and deserialization, use ComponentSerializer
- Since:
- 4.16.0
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(S input) Deserialize a component from input of typeS
.default O
deserializeOr
(S input, O fallback) Deserialize a component from input of typeS
.default O
deserializeOrNull
(S input) Deserialize a component from input of typeS
.
-
Method Details
-
deserialize
Deserialize a component from input of typeS
.- Parameters:
input
- the input- Returns:
- the component
- Since:
- 4.16.0
-
deserializeOrNull
@Contract(value="!null -> !null; null -> null", pure=true) @Nullable default O deserializeOrNull(@Nullable S input) Deserialize a component from input of typeS
.If
input
isnull
, thennull
will be returned.- Parameters:
input
- the input- Returns:
- the component if
input
is non-null, otherwisenull
- Since:
- 4.16.0
-
deserializeOr
@Contract(value="!null, _ -> !null; null, _ -> param2", pure=true) @Nullable default O deserializeOr(@Nullable S input, @Nullable O fallback) Deserialize a component from input of typeS
.If
input
isnull
, thenfallback
will be returned.- Parameters:
input
- the inputfallback
- the fallback value- Returns:
- the component if
input
is non-null, otherwisefallback
- Since:
- 4.16.0
-