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

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

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

import net.jbock.Option;
import net.jbock.common.EnumName;

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

import static net.jbock.annotated.AnnotatedOption.createOption;
import static net.jbock.common.Constants.optionalString;

final class ExecutableOption extends Executable {

    private final Option option;

    ExecutableOption(ExecutableElement method, Option option) {
        super(method);
        this.option = option;
    }

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

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

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

    List names() {
        return List.of(option.names());
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy