Package io.nitric.util
Class ProtoUtils
- java.lang.Object
-
- io.nitric.util.ProtoUtils
-
public class ProtoUtils extends Object
Provides protobuf utility functions.
This class has code derived from method in the
com.google.api.graphql.grpc
library
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RuntimeException
mapGrpcError(io.grpc.StatusRuntimeException sre)
Map the gRPC error to representative Java exception.static Map<String,Object>
toMap(com.google.protobuf.Struct struct)
Return a new Map built from the given struct.static com.google.protobuf.Struct
toStruct(Map<String,Object> map)
Return a new Struct built from the given Map.
-
-
-
Method Detail
-
mapGrpcError
public static RuntimeException mapGrpcError(io.grpc.StatusRuntimeException sre)
Map the gRPC error to representative Java exception.- Parameters:
sre
- the GRPC error (required)- Returns:
- a representative Java exception
-
toMap
public static Map<String,Object> toMap(com.google.protobuf.Struct struct)
Return a new Map built from the given struct.- Parameters:
struct
- the protobuf Struct object- Returns:
- a Map object.
-
-