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

net.jbock.annotated.ExecutableParameter Maven / Gradle / Ivy

There is a newer version: 5.18
Show newest version
package net.jbock.annotated;

import net.jbock.Parameter;
import net.jbock.common.EnumName;

import javax.lang.model.element.ExecutableElement;
import java.util.List;
import java.util.Optional;

import static net.jbock.annotated.AnnotatedParameter.createParameter;
import static net.jbock.common.Constants.optionalString;

final class ExecutableParameter extends Executable {

    private final Parameter parameter;

    ExecutableParameter(ExecutableElement method, Parameter parameter) {
        super(method);
        this.parameter = parameter;
    }

    @Override
    AnnotatedMethod annotatedMethod(EnumName enumName) {
        return createParameter(this, enumName);
    }

    @Override
    Optional descriptionKey() {
        return optionalString(parameter.descriptionKey());
    }

    @Override
    List description() {
        return List.of(parameter.description());
    }

    Optional paramLabel() {
        return optionalString(parameter.paramLabel());
    }

    int index() {
        return parameter.index();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy