Package io.activej.serializer.stream
Class StreamCodecs
java.lang.Object
io.activej.serializer.stream.StreamCodecs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> StreamCodec<T[]>ofArray(StreamCodec<T> itemCodec, IntFunction<T[]> factory) static <T> StreamCodec<T[]>ofArray(IntFunction<? extends StreamCodec<? extends T>> itemCodecFn, IntFunction<T[]> factory) static StreamCodec<Boolean>static StreamCodec<boolean[]>static StreamCodec<Byte>ofByte()static StreamCodec<byte[]>static StreamCodec<Character>ofChar()static StreamCodec<char[]>static <T> StreamCodec<Collection<T>>ofCollection(StreamCodec<T> itemCodec) static <T,C extends Collection<T>>
StreamCodec<C>ofCollection(StreamCodec<T> itemCodec, IntFunction<C> factory) static StreamCodec<Double>ofDouble()static StreamCodec<double[]>static <E extends Enum<E>>
StreamCodec<E>static <E extends Enum<E>,V>
StreamCodec<Map<E,V>> ofEnumMap(Class<E> type, StreamCodec<V> valueCodec) static <E extends Enum<E>>
StreamCodec<Set<E>>static StreamCodec<Float>ofFloat()static StreamCodec<float[]>static StreamCodec<Integer>ofInt()static StreamCodec<int[]>static <T> StreamCodec<List<T>>ofList(StreamCodec<T> itemCodec) static <T> StreamCodec<List<T>>ofList(IntFunction<? extends StreamCodec<? extends T>> itemCodecFn) static StreamCodec<Long>ofLong()static StreamCodec<long[]>static <K,V> StreamCodec<Map<K, V>> ofMap(StreamCodec<K> keyCodec, StreamCodec<V> valueCodec) static <K,V> StreamCodec<Map<K, V>> ofMap(StreamCodec<K> keyCodec, Function<? super K, ? extends StreamCodec<? extends V>> valueCodecFn) static <K,V, M extends Map<K, V>>
StreamCodec<M>ofMap(StreamCodec<K> keyCodec, Function<? super K, ? extends StreamCodec<? extends V>> valueCodecFn, IntFunction<M> factory) static <T> StreamCodec<@Nullable T>ofNullable(StreamCodec<@NotNull T> codec) static <T> StreamCodec<Optional<T>>ofOptional(StreamCodec<T> codec) static <T> StreamCodec<Set<T>>ofSet(StreamCodec<T> itemCodec) static StreamCodec<Short>ofShort()static StreamCodec<short[]>static StreamCodec<String>ofString()static <T> StreamCodec<T>ofSubtype(LinkedHashMap<Class<? extends T>, StreamCodec<? extends T>> codecs) static StreamCodec<Integer>ofVarInt()static StreamCodec<int[]>static StreamCodec<Long>static StreamCodec<long[]>static StreamCodec<Void>ofVoid()static <T> StreamCodec<T>reference(StreamCodec<T> codec) static <T> StreamCodec<T>singleton(T instance) static <T,R> StreamCodec<R> transform(StreamCodec<T> codec, Function<T, ? extends R> reader, Function<R, T> writer)
-
Constructor Details
-
StreamCodecs
public StreamCodecs()
-
-
Method Details
-
ofVoid
-
ofBoolean
-
ofChar
-
ofByte
-
ofShort
-
ofInt
-
ofVarInt
-
ofLong
-
ofVarLong
-
ofFloat
-
ofDouble
-
ofString
-
ofBooleanArray
-
ofCharArray
-
ofByteArray
-
ofShortArray
-
ofIntArray
-
ofLongArray
-
ofFloatArray
-
ofDoubleArray
-
ofVarIntArray
-
ofVarLongArray
-
ofArray
-
ofArray
public static <T> StreamCodec<T[]> ofArray(IntFunction<? extends StreamCodec<? extends T>> itemCodecFn, IntFunction<T[]> factory) -
ofEnum
-
ofOptional
-
ofCollection
public static <T,C extends Collection<T>> StreamCodec<C> ofCollection(StreamCodec<T> itemCodec, IntFunction<C> factory) -
ofCollection
-
ofSet
-
ofEnumSet
-
ofList
-
ofList
public static <T> StreamCodec<List<T>> ofList(IntFunction<? extends StreamCodec<? extends T>> itemCodecFn) -
ofMap
public static <K,V> StreamCodec<Map<K,V>> ofMap(StreamCodec<K> keyCodec, StreamCodec<V> valueCodec) -
ofMap
public static <K,V> StreamCodec<Map<K,V>> ofMap(StreamCodec<K> keyCodec, Function<? super K, ? extends StreamCodec<? extends V>> valueCodecFn) -
ofEnumMap
public static <E extends Enum<E>,V> StreamCodec<Map<E,V>> ofEnumMap(Class<E> type, StreamCodec<V> valueCodec) -
ofMap
public static <K,V, StreamCodec<M> ofMapM extends Map<K, V>> (StreamCodec<K> keyCodec, Function<? super K, ? extends StreamCodec<? extends V>> valueCodecFn, IntFunction<M> factory) -
ofSubtype
public static <T> StreamCodec<T> ofSubtype(LinkedHashMap<Class<? extends T>, StreamCodec<? extends T>> codecs) -
ofNullable
-
transform
public static <T,R> StreamCodec<R> transform(StreamCodec<T> codec, Function<T, ? extends R> reader, Function<R, T> writer) -
singleton
-
reference
-