@Override
      public PrettyPrintableKind visitDeclared(DeclaredType declaredType, Void v) {
        TypeElement typeElement = asTypeElement(declaredType);
        if (toPrettyStringMethod(typeElement, types, elements).isPresent()) {
          return HAS_TO_PRETTY_STRING_METHOD;
        }
        PrettyPrintableKind byExactType =
            KINDS_BY_EXACT_TYPE.get(typeElement.getQualifiedName().toString());
        if (byExactType != null) {
          return byExactType;
        }

        for (Map.Entry<String, PrettyPrintableKind> entry : KINDS_BY_SUPERTYPE.entrySet()) {
          TypeElement supertypeElement = elements.getTypeElement(entry.getKey());
          if (supertypeElement != null
              && types.isAssignable(declaredType, types.erasure(supertypeElement.asType()))) {
            return entry.getValue();
          }
        }

        return REGULAR_OBJECT;
      }
Returns a valid Java identifier for method or variable of type {@code type}.
value/src/main/java/com/google/auto/value/extension/toprettystring/processor/ToPrettyStringExtension.java