public static Optional < String > asStringValue ( Attribute a ) { class Visitor extends SimpleAnnotationValueVisitor8 < String , Void > { @ Override public String visitString ( String s , Void unused ) { return s ; } } return Optional . ofNullable ( a . accept ( new Visitor ( ) , null ) ) ; }
Converts the given attribute to an string value .