MCPcopy Create free account
hub / github.com/google/auto / asElement

Method asElement

common/src/main/java/com/google/auto/common/MoreTypes.java:543–545  ·  view source on GitHub ↗

An alternate implementation of Types#asElement that does not require a Types instance with the notable difference that it will throw IllegalArgumentException instead of returning null if the TypeMirror can not be converted to an Element. @throws NullPointerEx

(TypeMirror typeMirror)

Source from the content-addressed store, hash-verified

541 * Element}
542 */
543 public static Element asElement(TypeMirror typeMirror) {
544 return typeMirror.accept(AsElementVisitor.INSTANCE, null);
545 }
546
547 private static final class AsElementVisitor extends SimpleTypeVisitor8<Element, Void> {
548 private static final AsElementVisitor INSTANCE = new AsElementVisitor();

Callers 15

asElement_throwsMethod · 0.95
asElementMethod · 0.95
asTypeElementMethod · 0.95
validateClassValuesMethod · 0.95
isNullableMethod · 0.45
createMethod · 0.45
getQualifiedNameMethod · 0.45
visitDeclaredMethod · 0.45
visitTypeVariableMethod · 0.45
visitDeclaredMethod · 0.45
visitDeclaredMethod · 0.45

Calls 1

acceptMethod · 0.45

Tested by 4

asElement_throwsMethod · 0.76
asElementMethod · 0.76
getSerializerMethod · 0.36