All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.codetrans.expression.ArraysModel Maven / Gradle / Ivy

There is a newer version: 4.1.0.Beta1
Show newest version
package io.vertx.codetrans.expression;

import io.vertx.codegen.type.TypeInfo;
import io.vertx.codetrans.CodeBuilder;
import io.vertx.codetrans.MethodSignature;
import io.vertx.codetrans.TypeArg;

import java.util.List;

/**
 * @author Julien Viet
 */
public class ArraysModel extends ClassModel {

  public ArraysModel(CodeBuilder builder) {
    super(builder);
  }

  @Override
  public ExpressionModel onMethodInvocation(TypeInfo receiverType, MethodSignature method, TypeInfo returnType, List typeArguments, List arguments, List argumentTypes) {
    if (method.getName().equals("asList")) {
      return builder.render(writer -> {
        writer.renderListLiteral(arguments);
      });
    }
    return super.onMethodInvocation(receiverType, method, returnType, typeArguments, arguments, argumentTypes);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy