Interface ComponentEncoder<I extends Component,R> 
- Type Parameters:
- I- the input component type
- R- the serialized type
- All Known Subinterfaces:
- ComponentSerializer<I,- O, - R> 
public interface ComponentEncoder<I extends Component,R> 
A 
Component encoder, which provides serialization, but without deserialization.
 For both serialization and deserialization, use ComponentSerializer
- Since:
- 4.14.0
- 
Method SummaryModifier and TypeMethodDescriptionSerializes a component into an output of typeR.default RserializeOr(I component, R fallback) Serializes a component into an output of typeR.default RserializeOrNull(I component) Serializes a component into an output of typeR.
- 
Method Details- 
serializeSerializes a component into an output of typeR.- Parameters:
- component- the component
- Returns:
- the output
- Since:
- 4.14.0
 
- 
serializeOrNull@Contract(value="!null -> !null; null -> null", pure=true) @Nullable default R serializeOrNull(@Nullable I component) Serializes a component into an output of typeR.If componentisnull, thennullwill be returned.- Parameters:
- component- the component
- Returns:
- the output if componentis non-null, otherwisenull
- Since:
- 4.14.0
 
- 
serializeOr@Contract(value="!null, _ -> !null; null, _ -> param2", pure=true) @Nullable default R serializeOr(@Nullable I component, @Nullable R fallback) Serializes a component into an output of typeR.If componentisnull, thenfallbackwill be returned.- Parameters:
- component- the component
- fallback- the fallback value
- Returns:
- the output if componentis non-null, otherwisefallback
- Since:
- 4.14.0
 
 
-