Code example for TypeToken

Methods: equalstoString

0
            return new Key<T>(type, annotation);
        } 
 
        @Override 
        public String toString() {
            if (getTypeToken().equals(TypeToken.of(String.class))) {
                return toString(getAnnotation()); 
            } 
            String annotation = toString(getAnnotation());
            if (annotation != null) {
                return "@" + getTypeToken().toString() + "." + annotation;
            } else { 
                return "@" + getTypeToken().toString();
            } 
        } 
 
        public static String toString(Annotation annotation) {
            if (annotation == null) return null;
            if (annotation instanceof Named) {
                return ((Named)annotation).value();