public static Optional < Integer > asIntegerValue ( Attribute a ) { class Visitor extends SimpleAnnotationValueVisitor8 < Integer , Void > { @ Override public Integer visitInt ( int i , Void unused ) { return i ; } } return Optional . ofNullable ( a . accept ( new Visitor ( ) , null ) ) ; }
Converts the given attribute to an integer value .