public final String toSchema() { StringBuilder builder = new StringBuilder(); appendDocumentation(builder, documentation()); builder.append("rpc ") .append(name()) .append(" ("); if (requestStreaming()) { builder.append("stream "); } builder.append(requestType()) .append(") returns ("); if (responseStreaming()) { builder.append("stream "); } builder.append(responseType()) .append(')'); if (!options().isEmpty()) { builder.append(" {\n"); for (OptionElement option : options()) { appendIndented(builder, option.toSchemaDeclaration()); } builder.append("}"); } return builder.append(";\n").toString(); }
static ImmutableList<Rpc> fromElements(ImmutableList<RpcElement> elements) { ImmutableList.Builder<Rpc> rpcs = new ImmutableList.Builder<>(); for (RpcElement rpcElement : elements) { rpcs.add(new Rpc(rpcElement.location(), rpcElement.name(), rpcElement.documentation(), rpcElement.requestType(), rpcElement.responseType(), rpcElement.requestStreaming(), rpcElement.responseStreaming(), new Options(Options.METHOD_OPTIONS, rpcElement.options()))); } return rpcs.build(); }
public final String toSchema() { StringBuilder builder = new StringBuilder(); appendDocumentation(builder, documentation()); builder.append("rpc ") .append(name()) .append(" ("); if (requestStreaming()) { builder.append("stream "); } builder.append(requestType()) .append(") returns ("); if (responseStreaming()) { builder.append("stream "); } builder.append(responseType()) .append(')'); if (!options().isEmpty()) { builder.append(" {\n"); for (OptionElement option : options()) { appendIndented(builder, option.toSchemaDeclaration()); } builder.append("}"); } return builder.append(";\n").toString(); }
public final String toSchema() { StringBuilder builder = new StringBuilder(); appendDocumentation(builder, documentation()); builder.append("rpc ") .append(name()) .append(" ("); if (requestStreaming()) { builder.append("stream "); } builder.append(requestType()) .append(") returns ("); if (responseStreaming()) { builder.append("stream "); } builder.append(responseType()) .append(')'); if (!options().isEmpty()) { builder.append(" {\n"); for (OptionElement option : options()) { appendIndented(builder, option.toSchemaDeclaration()); } builder.append("}"); } return builder.append(";\n").toString(); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof RpcElement) { RpcElement that = (RpcElement) o; return (this.location.equals(that.location())) && (this.name.equals(that.name())) && (this.documentation.equals(that.documentation())) && (this.requestType.equals(that.requestType())) && (this.responseType.equals(that.responseType())) && (this.requestStreaming == that.requestStreaming()) && (this.responseStreaming == that.responseStreaming()) && (this.options.equals(that.options())); } return false; }
static ImmutableList<Rpc> fromElements(ImmutableList<RpcElement> elements) { ImmutableList.Builder<Rpc> rpcs = new ImmutableList.Builder<>(); for (RpcElement rpcElement : elements) { rpcs.add(new Rpc(rpcElement.location(), rpcElement.name(), rpcElement.documentation(), rpcElement.requestType(), rpcElement.responseType(), rpcElement.requestStreaming(), rpcElement.responseStreaming(), new Options(Options.METHOD_OPTIONS, rpcElement.options()))); } return rpcs.build(); }
static ImmutableList<Rpc> fromElements(ImmutableList<RpcElement> elements) { ImmutableList.Builder<Rpc> rpcs = new ImmutableList.Builder<>(); for (RpcElement rpcElement : elements) { rpcs.add(new Rpc(rpcElement.location(), rpcElement.name(), rpcElement.documentation(), rpcElement.requestType(), rpcElement.responseType(), rpcElement.requestStreaming(), rpcElement.responseStreaming(), new Options(Options.METHOD_OPTIONS, rpcElement.options()))); } return rpcs.build(); }
Builder(RpcElement source) { this.location = source.location(); this.name = source.name(); this.documentation = source.documentation(); this.requestType = source.requestType(); this.responseType = source.responseType(); this.requestStreaming = source.requestStreaming(); this.responseStreaming = source.responseStreaming(); this.options = source.options(); } @Override