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 ofRequestFactorythat 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.EventBusgetEventBus()Returns the last value passed toinitialize(EventBus, RequestTransport).java.lang.StringgetHistoryToken(EntityProxyId<?> proxy)Returnsnull.java.lang.StringgetHistoryToken(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.RequestTransportgetRequestTransport()Returns the last value passed toinitialize(EventBus, RequestTransport).ProxySerializergetSerializer(ProxyStore store)Returnsnull.voidinitialize(EventBus eventBus)Equivalent toinitialize(eventBus, new FakeRequestTransport()).voidinitialize(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:
findin interfaceRequestFactory- Parameters:
proxyId- anEntityProxyIdinstance of type P- Returns:
- a
Requestobject - See Also:
RequestContext.find(EntityProxyId)
-
getEventBus
public EventBus getEventBus()
Returns the last value passed toinitialize(EventBus, RequestTransport).- Specified by:
getEventBusin interfaceRequestFactory- Returns:
- the
EventBusassociated with this instance
-
getHistoryToken
public java.lang.String getHistoryToken(java.lang.Class<? extends EntityProxy> clazz)
Returnsnull.- Specified by:
getHistoryTokenin interfaceRequestFactory- Parameters:
clazz- a Class object for anEntityProxysubclass- Returns:
- a
Historycompatible token
-
getHistoryToken
public java.lang.String getHistoryToken(EntityProxyId<?> proxy)
Returnsnull.- Specified by:
getHistoryTokenin interfaceRequestFactory- Parameters:
proxy- anEntityProxyIdinstance- Returns:
- a
Historycompatible token
-
getProxyClass
public java.lang.Class<? extends EntityProxy> getProxyClass(java.lang.String historyToken)
Returnsnull.- Specified by:
getProxyClassin interfaceRequestFactory- Parameters:
historyToken- a String token- Returns:
- a Class object for an
EntityProxysubclass
-
getProxyId
public <T extends EntityProxy> EntityProxyId<T> getProxyId(java.lang.String historyToken)
Returnsnull.- Specified by:
getProxyIdin interfaceRequestFactory- Parameters:
historyToken- a String token- Returns:
- an
EntityProxyId
-
getRequestTransport
public RequestTransport getRequestTransport()
Returns the last value passed toinitialize(EventBus, RequestTransport).- Specified by:
getRequestTransportin interfaceRequestFactory- Returns:
- the
RequestTransportassociated with this instance
-
getSerializer
public ProxySerializer getSerializer(ProxyStore store)
Returnsnull.- Specified by:
getSerializerin 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:
initializein interfaceRequestFactory- Parameters:
eventBus- anEventBus
-
initialize
public void initialize(EventBus eventBus, RequestTransport transport)
Saves the parameters for later retrieval.- Specified by:
initializein interfaceRequestFactory- Parameters:
eventBus- anEventBustransport- aRequestTransportinstance
-
-