Package io.lettuce.core.dynamic.segment
Class CommandSegments
- java.lang.Object
-
- io.lettuce.core.dynamic.segment.CommandSegments
-
- All Implemented Interfaces:
Iterable<CommandSegment>
public class CommandSegments extends Object implements Iterable<CommandSegment>
Value object abstracting multipleCommandSegment
s.- Since:
- 5.0
- Author:
- Mark Paluch
-
-
Constructor Summary
Constructors Constructor Description CommandSegments(List<CommandSegment> segments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProtocolKeyword
getCommandType()
Iterator<CommandSegment>
iterator()
protected ProtocolKeyword
potentiallyResolveCommand(String commandType)
Attempt to resolve thecommandType
againstCommandType
.int
size()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
CommandSegments
public CommandSegments(List<CommandSegment> segments)
- Parameters:
segments
- must not benull.
-
-
Method Detail
-
potentiallyResolveCommand
protected ProtocolKeyword potentiallyResolveCommand(String commandType)
Attempt to resolve thecommandType
againstCommandType
. This allows reuse of settings associated with the actual command type such as read-write routing. Subclasses may override this method.- Parameters:
commandType
- must not benull
.- Returns:
- the resolved
ProtocolKeyword
. - Since:
- 5.0.5
-
iterator
public Iterator<CommandSegment> iterator()
- Specified by:
iterator
in interfaceIterable<CommandSegment>
-
getCommandType
public ProtocolKeyword getCommandType()
-
size
public int size()
-
-