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> GetsDeserializer
which thisSerialization
has.boolean
Checks if thisSerialization
hasDeserializer
.boolean
Checks if thisSerialization
hasSerializer
.static <T,
S> @NotNull Serialization<T, S> onlyDeserializer
(@NotNull Deserializer<? super S, ? extends T> deserializer) Creates a newSerialization
fromDeserializer
.static <T,
S> @NotNull Serialization<T, S> onlySerializer
(@NotNull Serializer<? super T, ? extends S> serializer) Creates a newSerialization
fromSerializer
.@NotNull Serializer<? super T,
? extends S> GetsSerializer
which thisSerialization
has.
-
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
- theSerializer
deserializer
- theDeserializer
- Returns:
- the
Serialization
that hasSerializer
andDeserializer
-
onlySerializer
@NotNull static <T,S> @NotNull Serialization<T,S> onlySerializer(@NotNull @NotNull Serializer<? super T, ? extends S> serializer) Creates a newSerialization
fromSerializer
.- Type Parameters:
T
- the type of objectsS
- the type of serialized results- Parameters:
serializer
- theSerializer
- Returns:
- the
Serialization
that has onlySerializer
-
onlyDeserializer
@NotNull static <T,S> @NotNull Serialization<T,S> onlyDeserializer(@NotNull @NotNull Deserializer<? super S, ? extends T> deserializer) Creates a newSerialization
fromDeserializer
.- Type Parameters:
T
- the type of objectsS
- the type of serialized results- Parameters:
deserializer
- theDeserializer
- Returns:
- the
Serialization
that has onlyDeserializer
-
hasSerializer
boolean hasSerializer()Checks if thisSerialization
hasSerializer
.- Returns:
true
if thisSerialization
hasSerializer
, otherwisefalse
-
serializer
GetsSerializer
which thisSerialization
has.- Returns:
Serializer
which thisSerialization
has
-
hasDeserializer
boolean hasDeserializer()Checks if thisSerialization
hasDeserializer
.- Returns:
true
if thisSerialization
hasDeserializer
, otherwisefalse
-
deserializer
GetsDeserializer
which thisSerialization
has.- Returns:
Deserializer
which thisSerialization
has
-