Search in sources :

Example 1 with Mixin

use of com.google.protobuf.Mixin in project toolkit by googleapis.

the class ProtoInterfaceModel method getMethods.

@Override
public List<MethodModel> getMethods() {
    ImmutableList.Builder<MethodModel> methods = ImmutableList.builder();
    for (Method method : protoInterface.getMethods()) {
        methods.add(new ProtoMethodModel(method));
    }
    SymbolTable symbolTable = protoInterface.getModel().getSymbolTable();
    for (Mixin mixin : protoInterface.getConfig().getMixinsList()) {
        Interface mixinInterface = symbolTable.lookupInterface(mixin.getName());
        for (Method method : mixinInterface.getMethods()) {
            methods.add(new ProtoMethodModel(method));
        }
    }
    return methods.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) SymbolTable(com.google.api.tools.framework.model.SymbolTable) Method(com.google.api.tools.framework.model.Method) Interface(com.google.api.tools.framework.model.Interface) Mixin(com.google.protobuf.Mixin)

Aggregations

Interface (com.google.api.tools.framework.model.Interface)1 Method (com.google.api.tools.framework.model.Method)1 SymbolTable (com.google.api.tools.framework.model.SymbolTable)1 ImmutableList (com.google.common.collect.ImmutableList)1 Mixin (com.google.protobuf.Mixin)1