public class DefaultProxyStore extends Object implements ProxyStore
Constructor and Description |
---|
DefaultProxyStore()
Construct an empty DefaultProxyStore.
|
DefaultProxyStore(String payload)
Construct a DefaultProxyStore using the a value returned from
encode() . |
Modifier and Type | Method and Description |
---|---|
String |
encode()
Return a JSON object literal with the contents of the store.
|
Splittable |
get(String key)
Called by
ProxySerializer to retrieve a value previously provided
to ProxyStore.put(String, Splittable) . |
int |
nextId()
Returns a non-negative sequence number.
|
void |
put(String key,
Splittable value)
Called by
ProxySerializer to store a value. |
public DefaultProxyStore()
public DefaultProxyStore(String payload) throws IllegalArgumentException
encode()
.payload
- a String previously returned from encode()
IllegalArgumentException
- if the payload cannot be parsedpublic String encode()
public Splittable get(String key)
ProxyStore
ProxySerializer
to retrieve a value previously provided
to ProxyStore.put(String, Splittable)
.get
in interface ProxyStore
key
- the keynull
if key
is unknownpublic int nextId()
ProxyStore
nextId
in interface ProxyStore
public void put(String key, Splittable value)
ProxyStore
ProxySerializer
to store a value.put
in interface ProxyStore
key
- a key value that will be passed to ProxyStore.get(String)
value
- the data to storeSplittable.getPayload()
Copyright © 2016. All rights reserved.