net.jbock.annotated.ExecutableOption Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jbock-compiler Show documentation
Show all versions of jbock-compiler Show documentation
jbock annotation processor
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());
}
}