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

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

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

import net.jbock.Parameters;
import net.jbock.common.EnumName;

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

import static net.jbock.annotated.AnnotatedParameters.createParameters;
import static net.jbock.common.Constants.optionalString;

final class ExecutableParameters extends Executable {

    private final Parameters parameters;

    ExecutableParameters(ExecutableElement method, Parameters parameters) {
        super(method);
        this.parameters = parameters;
    }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy