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

下面列出了怎么用com.google.protobuf.DescriptorProtos.MethodOptions的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: 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);
}
 
源代码2 项目: 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();
}
 
源代码3 项目: 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);
}
 
源代码4 项目: play-store-api   文件: Descriptors.java
/**
 * Get the {@code MethodOptions}, defined in {@code descriptor.proto}.
 */
public MethodOptions getOptions() { return proto.getOptions(); }
 
 类所在包
 类方法
 同包方法