Code example for TypeToken

Methods: getRawTypegetType

0
      } 
      return (Key<? extends Function<HttpResponse, ?>>) Key.get(parserType);
   } 
 
   static Type getReturnTypeFor(TypeToken<?> typeToken) {
      Type returnVal = typeToken.getType();
      if (typeToken.getRawType().getTypeParameters().length == 0) {
         returnVal = typeToken.getRawType();
      } 
      return returnVal;
   } 
 
   // TODO: refactor this out of here 
   @VisibleForTesting 
   @SuppressWarnings({ "rawtypes", "unchecked" }) 
   public Function<HttpResponse, ?> getTransformerForMethod(Invocation invocation, Injector injector) {
      Invokable<?, ?> invoked = invocation.getInvokable();
      Function<HttpResponse, ?> transformer;
      if (invoked.isAnnotationPresent(SelectJson.class)) {
         Type returnVal = getReturnTypeFor(invoked.getReturnType());