Interface Serialization<T,S>
- Type Parameters:
T- the type of objectsS- the type of serialized results
- All Known Implementing Classes:
RecordSerialization
public interface Serialization<T,S>
An interface that holds
Serializer and/or Deserializer.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,S> @NotNull Serialization<T, S> create(@NotNull Serializer<? super T, ? extends S> serializer, @NotNull Deserializer<? super S, ? extends T> deserializer) @NotNull Deserializer<? super S,? extends T> GetsDeserializerwhich thisSerializationhas.booleanChecks if thisSerializationhasDeserializer.booleanChecks if thisSerializationhasSerializer.static <T,S> @NotNull Serialization<T, S> onlyDeserializer(@NotNull Deserializer<? super S, ? extends T> deserializer) Creates a newSerializationfromDeserializer.static <T,S> @NotNull Serialization<T, S> onlySerializer(@NotNull Serializer<? super T, ? extends S> serializer) Creates a newSerializationfromSerializer.@NotNull Serializer<? super T,? extends S> GetsSerializerwhich thisSerializationhas.
-
Method Details
-
create
@NotNull static <T,S> @NotNull Serialization<T,S> create(@NotNull @NotNull Serializer<? super T, ? extends S> serializer, @NotNull @NotNull Deserializer<? super S, ? extends T> deserializer) - Type Parameters:
T- the type of objectsS- the type of serialized results- Parameters:
serializer- theSerializerdeserializer- theDeserializer- Returns:
- the
Serializationthat hasSerializerandDeserializer
-
onlySerializer
@NotNull static <T,S> @NotNull Serialization<T,S> onlySerializer(@NotNull @NotNull Serializer<? super T, ? extends S> serializer) Creates a newSerializationfromSerializer.- Type Parameters:
T- the type of objectsS- the type of serialized results- Parameters:
serializer- theSerializer- Returns:
- the
Serializationthat has onlySerializer
-
onlyDeserializer
@NotNull static <T,S> @NotNull Serialization<T,S> onlyDeserializer(@NotNull @NotNull Deserializer<? super S, ? extends T> deserializer) Creates a newSerializationfromDeserializer.- Type Parameters:
T- the type of objectsS- the type of serialized results- Parameters:
deserializer- theDeserializer- Returns:
- the
Serializationthat has onlyDeserializer
-
hasSerializer
boolean hasSerializer()Checks if thisSerializationhasSerializer.- Returns:
trueif thisSerializationhasSerializer, otherwisefalse
-
serializer
GetsSerializerwhich thisSerializationhas.- Returns:
Serializerwhich thisSerializationhas
-
hasDeserializer
boolean hasDeserializer()Checks if thisSerializationhasDeserializer.- Returns:
trueif thisSerializationhasDeserializer, otherwisefalse
-
deserializer
GetsDeserializerwhich thisSerializationhas.- Returns:
Deserializerwhich thisSerializationhas
-