Package io.servicetalk.http.api
Class StrategyInfluencerChainBuilder
- java.lang.Object
-
- io.servicetalk.http.api.StrategyInfluencerChainBuilder
-
public final class StrategyInfluencerChainBuilder extends java.lang.ObjectA chain ofHttpExecutionStrategyInfluencer.
-
-
Constructor Summary
Constructors Constructor Description StrategyInfluencerChainBuilder()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(HttpExecutionStrategyInfluencer next)Append anotherHttpExecutionStrategyInfluencerto this chain.booleanappendIfInfluencer(java.lang.Object mayBeInfluencer)If the passedmayBeInfluenceris anHttpExecutionStrategyInfluencerthen add it to this chain.HttpExecutionStrategyInfluencerbuild()Builds this chain and returns the headHttpExecutionStrategyInfluencerfor the chain.HttpExecutionStrategyInfluencerbuild(HttpExecutionStrategy transportStrategy)Builds this chain and returns the headHttpExecutionStrategyInfluencerfor the chain.StrategyInfluencerChainBuildercopy()Creates a deep copy of thisStrategyInfluencerChainBuilder.voidprepend(HttpExecutionStrategyInfluencer influencer)Adds the passedHttpExecutionStrategyInfluencerto the head of this chain.booleanprependIfInfluencer(java.lang.Object mayBeInfluencer)If the passedmayBeInfluenceris anHttpExecutionStrategyInfluencerthen add it to the head of this chain.
-
-
-
Method Detail
-
prepend
public void prepend(HttpExecutionStrategyInfluencer influencer)
Adds the passedHttpExecutionStrategyInfluencerto the head of this chain.- Parameters:
influencer-HttpExecutionStrategyInfluencerto add.- Throws:
java.lang.IndexOutOfBoundsException- If the passed index is invalid.
-
prependIfInfluencer
public boolean prependIfInfluencer(java.lang.Object mayBeInfluencer)
If the passedmayBeInfluenceris anHttpExecutionStrategyInfluencerthen add it to the head of this chain.- Parameters:
mayBeInfluencer- An object which may be anHttpExecutionStrategyInfluencer.- Returns:
trueif the passedmayBeInfluencerwas added to the chain.- Throws:
java.lang.IndexOutOfBoundsException- If the passed index is invalid.
-
append
public void append(HttpExecutionStrategyInfluencer next)
Append anotherHttpExecutionStrategyInfluencerto this chain.- Parameters:
next-HttpExecutionStrategyInfluencerto append.
-
appendIfInfluencer
public boolean appendIfInfluencer(java.lang.Object mayBeInfluencer)
If the passedmayBeInfluenceris anHttpExecutionStrategyInfluencerthen add it to this chain.- Parameters:
mayBeInfluencer- An object which may be anHttpExecutionStrategyInfluencer.- Returns:
trueif the passedmayBeInfluencerwas added to the chain.
-
copy
public StrategyInfluencerChainBuilder copy()
Creates a deep copy of thisStrategyInfluencerChainBuilder.- Returns:
- A new
StrategyInfluencerChainBuildercontaining all the influencers added to thisStrategyInfluencerChainBuilder.
-
build
public HttpExecutionStrategyInfluencer build(HttpExecutionStrategy transportStrategy)
Builds this chain and returns the headHttpExecutionStrategyInfluencerfor the chain. InvokingHttpExecutionStrategyInfluencer.influenceStrategy(HttpExecutionStrategy)on the returnedHttpExecutionStrategyInfluencerwill invoke the method on the entire chain before returning.- Parameters:
transportStrategy-HttpExecutionStrategyfor the transport, typically specified by the user in the builders.- Returns:
HttpExecutionStrategyInfluencerwhich is the head of the influencer chain.
-
build
public HttpExecutionStrategyInfluencer build()
Builds this chain and returns the headHttpExecutionStrategyInfluencerfor the chain. InvokingHttpExecutionStrategyInfluencer.influenceStrategy(HttpExecutionStrategy)on the returnedHttpExecutionStrategyInfluencerwill invoke the method on the entire chain before returning.- Returns:
HttpExecutionStrategyInfluencerwhich is the head of the influencer chain.
-
-