Search in sources :

Example 1 with NamePath

use of com.google.api.codegen.util.NamePath in project toolkit by googleapis.

the class JavaSurfaceNamer method getGrpcServiceClassName.

/**
 * The type name of the Grpc service class This needs to match what Grpc generates for the
 * particular language.
 */
@Override
public String getGrpcServiceClassName(InterfaceModel apiInterface) {
    String fullName = JavaModelTypeNameConverter.getGrpcTypeName(((ProtoInterfaceModel) apiInterface).getInterface()).getFullName();
    NamePath namePath = getTypeNameConverter().getNamePath(fullName);
    String grpcContainerName = publicClassName(Name.upperCamelKeepUpperAcronyms(namePath.getHead(), "Grpc"));
    String serviceClassName = publicClassName(Name.upperCamelKeepUpperAcronyms(apiInterface.getSimpleName(), "ImplBase"));
    return qualifiedName(namePath.withHead(grpcContainerName).append(serviceClassName));
}
Also used : ProtoInterfaceModel(com.google.api.codegen.config.ProtoInterfaceModel) NamePath(com.google.api.codegen.util.NamePath)

Example 2 with NamePath

use of com.google.api.codegen.util.NamePath in project toolkit by googleapis.

the class SurfaceNamer method getGrpcContainerTypeName.

/**
 * The type name of the Grpc container class. This needs to match what Grpc generates for the
 * particular language.
 */
public String getGrpcContainerTypeName(InterfaceModel apiInterface) {
    NamePath namePath = typeNameConverter.getNamePath(getTypeFormatter().getFullNameFor(apiInterface));
    String publicClassName = publicClassName(Name.upperCamelKeepUpperAcronyms(namePath.getHead(), "Grpc"));
    return qualifiedName(namePath.withHead(publicClassName));
}
Also used : NamePath(com.google.api.codegen.util.NamePath)

Example 3 with NamePath

use of com.google.api.codegen.util.NamePath in project toolkit by googleapis.

the class SurfaceNamer method getGrpcServiceClassName.

/**
 * The type name of the Grpc service class This needs to match what Grpc generates for the
 * particular language.
 */
public String getGrpcServiceClassName(InterfaceModel apiInterface) {
    NamePath namePath = typeNameConverter.getNamePath(getTypeFormatter().getFullNameFor(apiInterface));
    String grpcContainerName = publicClassName(Name.upperCamelKeepUpperAcronyms(namePath.getHead(), "Grpc"));
    String serviceClassName = publicClassName(Name.upperCamelKeepUpperAcronyms(apiInterface.getSimpleName(), "ImplBase"));
    return qualifiedName(namePath.withHead(grpcContainerName).append(serviceClassName));
}
Also used : NamePath(com.google.api.codegen.util.NamePath)

Example 4 with NamePath

use of com.google.api.codegen.util.NamePath in project toolkit by googleapis.

the class PhpSurfaceNamer method getGrpcClientTypeName.

private NamePath getGrpcClientTypeName(InterfaceModel apiInterface, String suffix) {
    NamePath namePath = getTypeNameConverter().getNamePath(getModelTypeFormatter().getFullNameFor(apiInterface));
    String publicClassName = publicClassName(Name.upperCamelKeepUpperAcronyms(namePath.getHead(), suffix));
    return namePath.withHead(publicClassName);
}
Also used : NamePath(com.google.api.codegen.util.NamePath)

Example 5 with NamePath

use of com.google.api.codegen.util.NamePath in project toolkit by googleapis.

the class JavaSurfaceNamer method getGrpcContainerTypeName.

/**
 * The type name of the Grpc container class. This needs to match what Grpc generates for the
 * particular language.
 */
public String getGrpcContainerTypeName(InterfaceModel apiInterface) {
    String fullName = JavaModelTypeNameConverter.getGrpcTypeName(((ProtoInterfaceModel) apiInterface).getInterface()).getFullName();
    NamePath namePath = getTypeNameConverter().getNamePath(fullName);
    String publicClassName = publicClassName(Name.upperCamelKeepUpperAcronyms(namePath.getHead(), "Grpc"));
    return qualifiedName(namePath.withHead(publicClassName));
}
Also used : ProtoInterfaceModel(com.google.api.codegen.config.ProtoInterfaceModel) NamePath(com.google.api.codegen.util.NamePath)

Aggregations

NamePath (com.google.api.codegen.util.NamePath)6 ProtoInterfaceModel (com.google.api.codegen.config.ProtoInterfaceModel)2