Package io.servicetalk.http.api
Class StrategyInfluencerChainBuilder
- java.lang.Object
-
- io.servicetalk.http.api.StrategyInfluencerChainBuilder
-
public final class StrategyInfluencerChainBuilder extends java.lang.Object
A 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 void
append(HttpExecutionStrategyInfluencer next)
Append anotherHttpExecutionStrategyInfluencer
to this chain.boolean
appendIfInfluencer(java.lang.Object mayBeInfluencer)
If the passedmayBeInfluencer
is anHttpExecutionStrategyInfluencer
then add it to this chain.HttpExecutionStrategyInfluencer
build()
Builds this chain and returns the headHttpExecutionStrategyInfluencer
for the chain.HttpExecutionStrategyInfluencer
build(HttpExecutionStrategy transportStrategy)
Builds this chain and returns the headHttpExecutionStrategyInfluencer
for the chain.StrategyInfluencerChainBuilder
copy()
Creates a deep copy of thisStrategyInfluencerChainBuilder
.void
prepend(HttpExecutionStrategyInfluencer influencer)
Adds the passedHttpExecutionStrategyInfluencer
to the head of this chain.boolean
prependIfInfluencer(java.lang.Object mayBeInfluencer)
If the passedmayBeInfluencer
is anHttpExecutionStrategyInfluencer
then add it to the head of this chain.
-
-
-
Method Detail
-
prepend
public void prepend(HttpExecutionStrategyInfluencer influencer)
Adds the passedHttpExecutionStrategyInfluencer
to the head of this chain.- Parameters:
influencer
-HttpExecutionStrategyInfluencer
to add.- Throws:
java.lang.IndexOutOfBoundsException
- If the passed index is invalid.
-
prependIfInfluencer
public boolean prependIfInfluencer(java.lang.Object mayBeInfluencer)
If the passedmayBeInfluencer
is anHttpExecutionStrategyInfluencer
then add it to the head of this chain.- Parameters:
mayBeInfluencer
- An object which may be anHttpExecutionStrategyInfluencer
.- Returns:
true
if the passedmayBeInfluencer
was added to the chain.- Throws:
java.lang.IndexOutOfBoundsException
- If the passed index is invalid.
-
append
public void append(HttpExecutionStrategyInfluencer next)
Append anotherHttpExecutionStrategyInfluencer
to this chain.- Parameters:
next
-HttpExecutionStrategyInfluencer
to append.
-
appendIfInfluencer
public boolean appendIfInfluencer(java.lang.Object mayBeInfluencer)
If the passedmayBeInfluencer
is anHttpExecutionStrategyInfluencer
then add it to this chain.- Parameters:
mayBeInfluencer
- An object which may be anHttpExecutionStrategyInfluencer
.- Returns:
true
if the passedmayBeInfluencer
was added to the chain.
-
copy
public StrategyInfluencerChainBuilder copy()
Creates a deep copy of thisStrategyInfluencerChainBuilder
.- Returns:
- A new
StrategyInfluencerChainBuilder
containing all the influencers added to thisStrategyInfluencerChainBuilder
.
-
build
public HttpExecutionStrategyInfluencer build(HttpExecutionStrategy transportStrategy)
Builds this chain and returns the headHttpExecutionStrategyInfluencer
for the chain. InvokingHttpExecutionStrategyInfluencer.influenceStrategy(HttpExecutionStrategy)
on the returnedHttpExecutionStrategyInfluencer
will invoke the method on the entire chain before returning.- Parameters:
transportStrategy
-HttpExecutionStrategy
for the transport, typically specified by the user in the builders.- Returns:
HttpExecutionStrategyInfluencer
which is the head of the influencer chain.
-
build
public HttpExecutionStrategyInfluencer build()
Builds this chain and returns the headHttpExecutionStrategyInfluencer
for the chain. InvokingHttpExecutionStrategyInfluencer.influenceStrategy(HttpExecutionStrategy)
on the returnedHttpExecutionStrategyInfluencer
will invoke the method on the entire chain before returning.- Returns:
HttpExecutionStrategyInfluencer
which is the head of the influencer chain.
-
-