public static PrimitiveType asPrimitiveType(TypeMirror maybePrimitiveType) {
        return maybePrimitiveType.accept(new CastingTypeVisitor<PrimitiveType>() {
            @Override
            public PrimitiveType visitPrimitive(PrimitiveType type, String p) {
                return type;
            }
        }, "primitive type");
    }
Utilities related to {@link TypeMirror} instances.

@author Gregory Kick
@since 2.0
android/annotation_processors/xposed_hook_compiler/src/main/java/github/tornaco/permission/compiler/common/MoreTypes.java