001 package com.google.gwtmockito.fakes; 002 003 import com.google.gwtmockito.GwtMockito; 004 005 /** 006 * Interface implemented by an object capable of providing fake instances of a 007 * given type. Instances of this interface must be registered via 008 * {@link GwtMockito#useProviderForType}. 009 * 010 * @param <T> type that this interface can provide 011 * @author ekuefler@google.com (Erik Kuefler) 012 */ 013 public interface FakeProvider<T> { 014 /** 015 * Returns a fake implementation of the given type. 016 * 017 * @param type the actual type passed to GWT.create. Usually this is the same 018 * as T, but it could be a subtype or a completely unrelated type 019 * depending on how {@link GwtMockito#useProviderForType} was 020 * called. 021 */ 022 T getFake(Class<?> type); 023 }