net.jbock.common.SafeElements 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.common;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
import java.util.Optional;
public class SafeElements {
private final Elements elements;
public SafeElements(Elements elements) {
this.elements = elements;
}
public Optional getTypeElement(String name) {
return Optional.ofNullable(elements.getTypeElement(name));
}
}