Package io.inversion
Class Chain
- java.lang.Object
-
- io.inversion.Chain
-
public final class Chain extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classChain.ActionMatch
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Chain.ActionMatch>actionsstatic java.util.Set<java.lang.String>APPEND_PARAMSprotected booleancanceledprotected Engineengineprotected intnextprotected Chainparentprotected java.util.Set<java.lang.String>pathParamsToRemoveprotected Requestrequestprotected Responseresponseprotected Useruserprotected io.inversion.utils.LinkedCaseInsensitiveMap<java.lang.Object>vars
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringbuildLink(Collection collection)static java.lang.StringbuildLink(Collection collection, java.lang.String resourceKey)static java.lang.StringbuildLink(Collection collection, java.lang.String resourceKey, java.lang.String relationshipKey)static java.lang.StringbuildLink(io.inversion.json.JSMap fromHere, Relationship toHere)voidcancel()static voiddebug(java.lang.String format, java.lang.Object... args)ChainfilterPathParams(io.inversion.json.JSNode json)Recursively removes any url path params that appear as properties in the jsonstatic Chainfirst()protected static java.util.Stack<Chain>get()java.lang.Objectget(java.lang.String key)Storage for chain steps to communicate with each other.java.util.List<Chain.ActionMatch>getActions()ApigetApi()static intgetDepth()EndpointgetEndpoint()EnginegetEngine()ActiongetNext()ChaingetParent()RequestgetRequest()ResponsegetResponse()ServergetServer()static UsergetUser()voidgo()booleanhasNext()booleanisCanceled()booleanisDebug()static booleanisRoot()booleannext()static Chainpeek()static Chainpop()static Chainpush(Engine engine, Request req, Response res)voidput(java.lang.String key, java.lang.Object value)java.lang.Objectremove(java.lang.String key)static voidresetAll()voidsetParent(Chain parent)static intsize()ChainskipNext()static Chaintop()ChainwithAction(Chain.ActionMatch action)ChainwithActions(java.util.List<Chain.ActionMatch> actions)ChainwithUser(User user)
-
-
-
Field Detail
-
APPEND_PARAMS
public static final java.util.Set<java.lang.String> APPEND_PARAMS
-
engine
protected final Engine engine
-
actions
protected final java.util.List<Chain.ActionMatch> actions
-
request
protected final Request request
-
response
protected final Response response
-
vars
protected final io.inversion.utils.LinkedCaseInsensitiveMap<java.lang.Object> vars
-
next
protected int next
-
canceled
protected boolean canceled
-
user
protected User user
-
parent
protected Chain parent
-
pathParamsToRemove
protected java.util.Set<java.lang.String> pathParamsToRemove
-
-
Method Detail
-
resetAll
public static void resetAll()
-
get
protected static java.util.Stack<Chain> get()
-
getDepth
public static int getDepth()
-
isRoot
public static boolean isRoot()
-
first
public static Chain first()
-
top
public static Chain top() throws ApiException
- Throws:
ApiException
-
peek
public static Chain peek()
-
pop
public static Chain pop()
-
getUser
public static User getUser()
-
size
public static int size()
-
debug
public static void debug(java.lang.String format, java.lang.Object... args)
-
buildLink
public static java.lang.String buildLink(io.inversion.json.JSMap fromHere, Relationship toHere)
-
buildLink
public static java.lang.String buildLink(Collection collection)
-
buildLink
public static java.lang.String buildLink(Collection collection, java.lang.String resourceKey)
-
buildLink
public static java.lang.String buildLink(Collection collection, java.lang.String resourceKey, java.lang.String relationshipKey)
-
getParent
public Chain getParent()
-
setParent
public void setParent(Chain parent)
-
put
public void put(java.lang.String key, java.lang.Object value)
-
isDebug
public boolean isDebug()
-
get
public java.lang.Object get(java.lang.String key)
Storage for chain steps to communicate with each other.- Parameters:
key- the name of the value to retrieve- Returns:
- the value if it exists otherwise null
-
remove
public java.lang.Object remove(java.lang.String key)
-
go
public void go() throws ApiException- Throws:
ApiException
-
filterPathParams
public Chain filterPathParams(io.inversion.json.JSNode json)
Recursively removes any url path params that appear as properties in the json- Parameters:
json- the json node to clean- Returns:
- this
-
skipNext
public Chain skipNext()
-
getNext
public Action getNext()
-
next
public boolean next() throws ApiException- Throws:
ApiException
-
hasNext
public boolean hasNext()
-
isCanceled
public boolean isCanceled()
-
cancel
public void cancel()
-
getEngine
public Engine getEngine()
-
getApi
public Api getApi()
-
getServer
public Server getServer()
-
getEndpoint
public Endpoint getEndpoint()
-
getActions
public java.util.List<Chain.ActionMatch> getActions()
-
withActions
public Chain withActions(java.util.List<Chain.ActionMatch> actions)
-
withAction
public Chain withAction(Chain.ActionMatch action)
-
getRequest
public Request getRequest()
-
getResponse
public Response getResponse()
-
-