java.lang.Object
io.lettuce.core.dynamic.segment.CommandSegment
public abstract class CommandSegment extends Object
Value object representing a segment within a Redis Command.
A command segment is an ASCII string denoting a command, a named or an index-parameter reference.
- Since:
- 5.0
- Author:
- Mark Paluch
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommandSegment.ArgumentContribution -
Constructor Summary
Constructors Constructor Description CommandSegment() -
Method Summary
Modifier and Type Method Description abstract StringasString()abstract booleancanConsume(Parameter parameter)Check whether this segment can consume theParameterby applying parameter substitution.static CommandSegmentconstant(String content)Create a constantCommandSegment.abstract CommandSegment.ArgumentContributioncontribute(MethodParametersAccessor parametersAccessor)static CommandSegmentindexedParameter(int index)static CommandSegmentnamedParameter(String name)Create a named parameter referenceCommandSegment.StringtoString()
-
Constructor Details
-
CommandSegment
public CommandSegment()
-
-
Method Details
-
constant
Create a constantCommandSegment.- Parameters:
content- must not be empty ornull.- Returns:
- the
CommandSegment.
-
namedParameter
Create a named parameter referenceCommandSegment.- Parameters:
name- must not be empty ornull.- Returns:
-
indexedParameter
-
asString
- Returns:
- the command segment in its
representation
-
canConsume
Check whether this segment can consume theParameterby applying parameter substitution.- Parameters:
parameter-- Returns:
- Since:
- 5.1.3
-
contribute
public abstract CommandSegment.ArgumentContribution contribute(MethodParametersAccessor parametersAccessor)- Parameters:
parametersAccessor-- Returns:
-
toString
-