Code example for LoadingCache

Methods: getUnchecked

0
    this.fieldAccessorCache = CacheBuilder.newBuilder().build(new FieldAccessorLoader());
  } 
 
  @Override 
  public FieldAccessor getFieldAccessor(TypeToken<?> type, String fieldName) {
    return fieldAccessorCache.getUnchecked(new FieldEntry(type, fieldName));
  } 
 
  /** 
   * The {@link CacheLoader} for generating instance of {@link FieldAccessor} instance. 
   */ 
  private static final class FieldAccessorLoader extends CacheLoader<FieldEntry, FieldAccessor> {
 
    // See if are able to use the "defineClass" method in the ClassLoader of the field class. 
    private final Method defineClass;
 
    FieldAccessorLoader() { 
      Method defineClass = null;
      try { 
        defineClass = ClassLoader.class.getDeclaredMethod("defineClass", String.class,
Connect your IDE to all the code out there  Get Codota for Java