Package io.helidon.grpc.core
Class JavaMarshaller<T>
- java.lang.Object
-
- io.helidon.grpc.core.JavaMarshaller<T>
-
- Type Parameters:
T
- the type of value to to be marshalled
- All Implemented Interfaces:
io.grpc.MethodDescriptor.Marshaller<T>
@Singleton @Named("java") public class JavaMarshaller<T> extends Object implements io.grpc.MethodDescriptor.Marshaller<T>
An implementation of a gRPCMethodDescriptor.Marshaller
that uses Java serialization.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaMarshaller.Supplier
AMarshallerSupplier
implementation that supplies instances ofJavaMarshaller
.
-
Field Summary
Fields Modifier and Type Field Description static JavaMarshaller
INSTANCE
A singleton instance of aJavaMarshaller
.static String
NAME
The name of this marshaller.
-
Constructor Summary
Constructors Constructor Description JavaMarshaller()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> JavaMarshaller<T>
instance()
Obtain the singleton instance of aJavaMarshaller
.T
parse(InputStream in)
InputStream
stream(T obj)
-
-
-
Field Detail
-
NAME
public static final String NAME
The name of this marshaller.- See Also:
- Constant Field Values
-
INSTANCE
public static final JavaMarshaller INSTANCE
A singleton instance of aJavaMarshaller
.
-
-
Method Detail
-
instance
public static <T> JavaMarshaller<T> instance()
Obtain the singleton instance of aJavaMarshaller
.- Type Parameters:
T
- the type the marshaller supports- Returns:
- an instance of a
JavaMarshaller
-
stream
public InputStream stream(T obj)
- Specified by:
stream
in interfaceio.grpc.MethodDescriptor.Marshaller<T>
-
parse
public T parse(InputStream in)
- Specified by:
parse
in interfaceio.grpc.MethodDescriptor.Marshaller<T>
-
-