Java 类com.google.protobuf.DescriptorProtos.MethodOptions 实例源码

项目:api-compiler    文件:ProtoApiFromOpenApi.java   
/** Adds a {@link Method} from {@link Operation}. */
private void addMethodFromOperation(
    Service.Builder serviceBuilder,
    Operation operation,
    Path parentPath,
    String operationType,
    String path) {
  TypeInfo responseTypeInfo = getResponseTypeInfo(serviceBuilder, operation);
  TypeInfo requestType =
      getRequestTypeInfo(
          serviceBuilder,
          operation,
          parentPath,
          OpenApiLocations.createOperationLocation(operationType, path));

  com.google.protobuf.Method.Builder coreMethodBuilder =
      com.google.protobuf.Method.newBuilder()
          .setName(NameConverter.operationIdToMethodName(operation.getOperationId()))
          .setRequestTypeUrl(requestType.typeUrl())
          .setResponseTypeUrl(responseTypeInfo.typeUrl());
  if (operation.isDeprecated() != null && operation.isDeprecated()) {
    coreMethodBuilder.addOptions(
        createBoolOption(
            MethodOptions.getDescriptor()
                .findFieldByNumber(MethodOptions.DEPRECATED_FIELD_NUMBER)
                .getFullName(),
            true));
  }
  coreApiBuilder.addMethods(coreMethodBuilder);
}
项目:api-compiler    文件:DescriptorGenerator.java   
private MethodOptions generateMethodOptions(Method method) {
  MethodOptions.Builder builder = MethodOptions.newBuilder();
  setOptions(builder, method.getOptionsList(), METHOD_OPTION_NAME_PREFIX);
  return builder.build();
}
项目:api-compiler    文件:Method.java   
/**
 * Returns a method-level annotation, or null if it is a stream.
 */
public <T extends Message> T getMethodAnnotation(Extension<MethodOptions, T> extension) {
  return methodProto.getOptions().getExtension(extension);
}
项目:Beam    文件:Descriptors.java   
/**
 * Get the {@code MethodOptions}, defined in {@code descriptor.proto}.
 */
public MethodOptions getOptions () {
    return proto.getOptions ();
}
项目:protobuf-el    文件:Scopes.java   
public MethodOptions.Builder getMethodOptions() {
  return currentScope.getMethodOptions();
}
项目:protobuf-el    文件:Scopes.java   
protected MethodOptions.Builder getMethodOptions() {
  throw new RuntimeException(NOT_APPLICABLE_IN_CURRENT_SCOPE);
}
项目:protobuf-el    文件:Scopes.java   
@Override
protected MethodOptions.Builder getMethodOptions() {
  return protoBuilder.getOptionsBuilder();
}
项目:play-store-api    文件:Descriptors.java   
/**
 * Get the {@code MethodOptions}, defined in {@code descriptor.proto}.
 */
public MethodOptions getOptions() { return proto.getOptions(); }