Class FakeRequestFactory
- java.lang.Object
-
- com.google.web.bindery.requestfactory.shared.testing.FakeRequestFactory
-
- All Implemented Interfaces:
RequestFactory
public class FakeRequestFactory extends java.lang.Object implements RequestFactory
A no-op implementation ofRequestFactory
that can be used for building mocks.
-
-
Field Summary
-
Fields inherited from interface com.google.web.bindery.requestfactory.shared.RequestFactory
JSON_CONTENT_TYPE_UTF8
-
-
Constructor Summary
Constructors Constructor Description FakeRequestFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <P extends EntityProxy>
Request<P>find(EntityProxyId<P> proxyId)
Returnsnull
.EventBus
getEventBus()
Returns the last value passed toinitialize(EventBus, RequestTransport)
.java.lang.String
getHistoryToken(EntityProxyId<?> proxy)
Returnsnull
.java.lang.String
getHistoryToken(java.lang.Class<? extends EntityProxy> clazz)
Returnsnull
.java.lang.Class<? extends EntityProxy>
getProxyClass(java.lang.String historyToken)
Returnsnull
.<T extends EntityProxy>
EntityProxyId<T>getProxyId(java.lang.String historyToken)
Returnsnull
.RequestTransport
getRequestTransport()
Returns the last value passed toinitialize(EventBus, RequestTransport)
.ProxySerializer
getSerializer(ProxyStore store)
Returnsnull
.void
initialize(EventBus eventBus)
Equivalent toinitialize(eventBus, new FakeRequestTransport())
.void
initialize(EventBus eventBus, RequestTransport transport)
Saves the parameters for later retrieval.
-
-
-
Method Detail
-
find
public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId)
Returnsnull
.- Specified by:
find
in interfaceRequestFactory
- Parameters:
proxyId
- anEntityProxyId
instance of type P- Returns:
- a
Request
object - See Also:
RequestContext.find(EntityProxyId)
-
getEventBus
public EventBus getEventBus()
Returns the last value passed toinitialize(EventBus, RequestTransport)
.- Specified by:
getEventBus
in interfaceRequestFactory
- Returns:
- the
EventBus
associated with this instance
-
getHistoryToken
public java.lang.String getHistoryToken(java.lang.Class<? extends EntityProxy> clazz)
Returnsnull
.- Specified by:
getHistoryToken
in interfaceRequestFactory
- Parameters:
clazz
- a Class object for anEntityProxy
subclass- Returns:
- a
History
compatible token
-
getHistoryToken
public java.lang.String getHistoryToken(EntityProxyId<?> proxy)
Returnsnull
.- Specified by:
getHistoryToken
in interfaceRequestFactory
- Parameters:
proxy
- anEntityProxyId
instance- Returns:
- a
History
compatible token
-
getProxyClass
public java.lang.Class<? extends EntityProxy> getProxyClass(java.lang.String historyToken)
Returnsnull
.- Specified by:
getProxyClass
in interfaceRequestFactory
- Parameters:
historyToken
- a String token- Returns:
- a Class object for an
EntityProxy
subclass
-
getProxyId
public <T extends EntityProxy> EntityProxyId<T> getProxyId(java.lang.String historyToken)
Returnsnull
.- Specified by:
getProxyId
in interfaceRequestFactory
- Parameters:
historyToken
- a String token- Returns:
- an
EntityProxyId
-
getRequestTransport
public RequestTransport getRequestTransport()
Returns the last value passed toinitialize(EventBus, RequestTransport)
.- Specified by:
getRequestTransport
in interfaceRequestFactory
- Returns:
- the
RequestTransport
associated with this instance
-
getSerializer
public ProxySerializer getSerializer(ProxyStore store)
Returnsnull
.- Specified by:
getSerializer
in interfaceRequestFactory
- Parameters:
store
- a helper object for the ProxySerializer to provide low-level storage access- Returns:
- a new ProxySerializer
- See Also:
DefaultProxyStore
-
initialize
public void initialize(EventBus eventBus)
Equivalent toinitialize(eventBus, new FakeRequestTransport())
.- Specified by:
initialize
in interfaceRequestFactory
- Parameters:
eventBus
- anEventBus
-
initialize
public void initialize(EventBus eventBus, RequestTransport transport)
Saves the parameters for later retrieval.- Specified by:
initialize
in interfaceRequestFactory
- Parameters:
eventBus
- anEventBus
transport
- aRequestTransport
instance
-
-