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

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

package io.vertx.codetrans.expression;

import io.vertx.codegen.type.EnumTypeInfo;
import io.vertx.codetrans.CodeBuilder;
import io.vertx.codetrans.CodeWriter;

/**
 * @author Julien Viet
 */
public class EnumFieldExpressionModel extends ExpressionModel {

  private final EnumTypeInfo type;
  public final String identifier;

  public EnumFieldExpressionModel(CodeBuilder builder, EnumTypeInfo type, String identifier) {
    super(builder);
    this.type = type;
    this.identifier = identifier;
  }

  @Override
  public ExpressionModel toDataObjectValue() {
    return builder.toDataObjectValue(this);
  }

  @Override
  public void render(CodeWriter writer) {
    writer.renderEnumConstant(type, identifier);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy