private Interface(ProtoFile parent, ServiceDescriptorProto proto, String path) { super(parent, proto.getName(), path); this.proto = proto; // Build methods. ImmutableList.Builder<Method> methodsBuilder = ImmutableList.builder(); List<MethodDescriptorProto> methodProtos = proto.getMethodList(); for (int i = 0; i < methodProtos.size(); i++) { String childPath = buildPath(path, ServiceDescriptorProto.METHOD_FIELD_NUMBER, i); methodsBuilder.add(Method.create(this, methodProtos.get(i), childPath)); } methods = methodsBuilder.build(); }
private Interface(ProtoFile parent, ServiceDescriptorProto proto, String path) { super(parent, proto.getName(), path); this.proto = proto; // Build methods. ImmutableList.Builder<Method> methodsBuilder = ImmutableList.builder(); List<MethodDescriptorProto> methodProtos = proto.getMethodList(); for (int i = 0; i < methodProtos.size(); i++) { String childPath = buildPath(path, ServiceDescriptorProto.METHOD_FIELD_NUMBER, i); methodsBuilder.add(Method.create(this, methodProtos.get(i), childPath)); } methods = methodsBuilder.build(); }
Interface iface = Interface.create(file, ServiceDescriptorProto.getDefaultInstance(), ""); Method method = Method.create(iface, MethodDescriptorProto.newBuilder().setName(simpleName).build(), ""); RestMethod restMethod; ImmutableList<PathSegment> path = parse(model, template);