@Test void shouldSerializeLiteralMap() { Map<String, Literal> input = ImmutableMap.of("a", Literal.of(Scalar.of(Primitive.ofInteger(1337L)))); Literals.Primitive expectedPrimitive = Literals.Primitive.newBuilder().setInteger(1337L).build(); Literals.Scalar expectedScalar = Literals.Scalar.newBuilder().setPrimitive(expectedPrimitive).build(); Literals.LiteralMap expected = Literals.LiteralMap.newBuilder() .putLiterals("a", Literals.Literal.newBuilder().setScalar(expectedScalar).build()) .build(); Literals.LiteralMap output = ProtoUtil.serializeLiteralMap(input); assertEquals(expected, output); }
static Literals.LiteralMap serializeLiteralMap(Map<String, Literal> outputs) { Literals.LiteralMap.Builder builder = Literals.LiteralMap.newBuilder(); outputs.forEach((key, value) -> builder.putLiterals(key, serialize(value))); return builder.build(); }
ProtoUtil { static Literals.LiteralMap serializeLiteralMap(Map<String, Literal> outputs) { Literals.LiteralMap.Builder builder = Literals.LiteralMap.newBuilder(); outputs.forEach((key, value) -> builder.putLiterals(key, serialize(value))); return builder.build(); } }
ProtoUtil { static Literals.LiteralMap serializeLiteralMap(Map<String, Literal> outputs) { Literals.LiteralMap.Builder builder = Literals.LiteralMap.newBuilder(); outputs.forEach((key, value) -> builder.putLiterals(key, serialize(value))); return builder.build(); } private  ProtoUtil(); }
ProtoUtil { static Literals.LiteralMap serializeLiteralMap(Map<String, Literal> outputs) { Literals.LiteralMap.Builder builder = Literals.LiteralMap.newBuilder(); outputs.forEach((key, value) -> builder.putLiterals(key, serialize(value))); return builder.build(); } private  ProtoUtil(); static Workflow.WorkflowTemplate serialize(WorkflowTemplate template); }
ProtoUtil { static Literals.LiteralMap serializeLiteralMap(Map<String, Literal> outputs) { Literals.LiteralMap.Builder builder = Literals.LiteralMap.newBuilder(); outputs.forEach((key, value) -> builder.putLiterals(key, serialize(value))); return builder.build(); } private  ProtoUtil(); static Workflow.WorkflowTemplate serialize(WorkflowTemplate template);  }