@Test public void exampleUsage() { Message message = SimpleMessage.newBuilder().setName("bob").build(); Function<Message, ?> getter = protobufPath(message.getDescriptorForType(), "$.name"); assertThat(getter.apply(message), is("bob")); }
public static Function<Message, ?> protobufPath( Descriptors.Descriptor messageDescriptor, String pathString) { List<PathFragment> fields = ProtobufPathParser.parse(pathString); List<PathFragmentDescriptor> pathFragments = ProtobufPathCompiler.compile(messageDescriptor, fields); return new ProtobufDynamicMessageLens(pathFragments); }
ProtobufPath { public static Function<Message, ?> protobufPath( Descriptors.Descriptor messageDescriptor, String pathString) { List<PathFragment> fields = ProtobufPathParser.parse(pathString); List<PathFragmentDescriptor> pathFragments = ProtobufPathCompiler.compile(messageDescriptor, fields); return new ProtobufDynamicMessageLens(pathFragments); } }
ProtobufPath { public static Function<Message, ?> protobufPath( Descriptors.Descriptor messageDescriptor, String pathString) { List<PathFragment> fields = ProtobufPathParser.parse(pathString); List<PathFragmentDescriptor> pathFragments = ProtobufPathCompiler.compile(messageDescriptor, fields); return new ProtobufDynamicMessageLens(pathFragments); }  }
ProtobufPath { public static Function<Message, ?> protobufPath( Descriptors.Descriptor messageDescriptor, String pathString) { List<PathFragment> fields = ProtobufPathParser.parse(pathString); List<PathFragmentDescriptor> pathFragments = ProtobufPathCompiler.compile(messageDescriptor, fields); return new ProtobufDynamicMessageLens(pathFragments); }  static Function<Message, ?> protobufPath(
      Descriptors.Descriptor messageDescriptor, String pathString); }
ProtobufPath { public static Function<Message, ?> protobufPath( Descriptors.Descriptor messageDescriptor, String pathString) { List<PathFragment> fields = ProtobufPathParser.parse(pathString); List<PathFragmentDescriptor> pathFragments = ProtobufPathCompiler.compile(messageDescriptor, fields); return new ProtobufDynamicMessageLens(pathFragments); }  static Function<Message, ?> protobufPath(
      Descriptors.Descriptor messageDescriptor, String pathString);  }