public class FakeRequestFactory extends java.lang.Object implements RequestFactory
RequestFactory
that can be used for
building mocks.JSON_CONTENT_TYPE_UTF8
Constructor and Description |
---|
FakeRequestFactory() |
Modifier and Type | Method and Description |
---|---|
<P extends EntityProxy> |
find(EntityProxyId<P> proxyId)
Returns
null . |
EventBus |
getEventBus()
Returns the last value passed to
initialize(EventBus, RequestTransport) . |
java.lang.String |
getHistoryToken(java.lang.Class<? extends EntityProxy> clazz)
Returns
null . |
java.lang.String |
getHistoryToken(EntityProxyId<?> proxy)
Returns
null . |
java.lang.Class<? extends EntityProxy> |
getProxyClass(java.lang.String historyToken)
Returns
null . |
<T extends EntityProxy> |
getProxyId(java.lang.String historyToken)
Returns
null . |
RequestTransport |
getRequestTransport()
Returns the last value passed to
initialize(EventBus, RequestTransport) . |
ProxySerializer |
getSerializer(ProxyStore store)
Returns
null . |
void |
initialize(EventBus eventBus)
Equivalent to
initialize(eventBus, new FakeRequestTransport()) . |
void |
initialize(EventBus eventBus,
RequestTransport transport)
Saves the parameters for later retrieval.
|
public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId)
null
.find
in interface RequestFactory
proxyId
- an EntityProxyId
instance of type PRequest
objectRequestContext.find(EntityProxyId)
public EventBus getEventBus()
initialize(EventBus, RequestTransport)
.getEventBus
in interface RequestFactory
EventBus
associated with this instancepublic java.lang.String getHistoryToken(java.lang.Class<? extends EntityProxy> clazz)
null
.getHistoryToken
in interface RequestFactory
clazz
- a Class object for an EntityProxy
subclassHistory
compatible tokenpublic java.lang.String getHistoryToken(EntityProxyId<?> proxy)
null
.getHistoryToken
in interface RequestFactory
proxy
- an EntityProxyId
instanceHistory
compatible tokenpublic java.lang.Class<? extends EntityProxy> getProxyClass(java.lang.String historyToken)
null
.getProxyClass
in interface RequestFactory
historyToken
- a String tokenEntityProxy
subclasspublic <T extends EntityProxy> EntityProxyId<T> getProxyId(java.lang.String historyToken)
null
.getProxyId
in interface RequestFactory
historyToken
- a String tokenEntityProxyId
public RequestTransport getRequestTransport()
initialize(EventBus, RequestTransport)
.getRequestTransport
in interface RequestFactory
RequestTransport
associated with this instancepublic ProxySerializer getSerializer(ProxyStore store)
null
.getSerializer
in interface RequestFactory
store
- a helper object for the ProxySerializer to provide low-level
storage accessDefaultProxyStore
public void initialize(EventBus eventBus)
initialize(eventBus, new FakeRequestTransport())
.initialize
in interface RequestFactory
eventBus
- an EventBus
public void initialize(EventBus eventBus, RequestTransport transport)
initialize
in interface RequestFactory
eventBus
- an EventBus
transport
- a RequestTransport
instance