public abstract class CommandSegment extends Object
A command segment is an ASCII string denoting a command, a named or an index-parameter reference.
| Modifier and Type | Class and Description |
|---|---|
static class |
CommandSegment.ArgumentContribution |
| Constructor and Description |
|---|
CommandSegment() |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
asString() |
abstract boolean |
canConsume(Parameter parameter)
Check whether this segment can consume the
Parameter by applying parameter substitution. |
static CommandSegment |
constant(String content)
Create a constant
CommandSegment. |
abstract CommandSegment.ArgumentContribution |
contribute(MethodParametersAccessor parametersAccessor) |
static CommandSegment |
indexedParameter(int index) |
static CommandSegment |
namedParameter(String name)
Create a named parameter reference
CommandSegment. |
String |
toString() |
public static CommandSegment constant(String content)
CommandSegment.content - must not be empty or null.CommandSegment.public static CommandSegment namedParameter(String name)
CommandSegment.name - must not be empty or null.public static CommandSegment indexedParameter(int index)
public abstract String asString()
representationpublic abstract boolean canConsume(Parameter parameter)
Parameter by applying parameter substitution.parameter - public abstract CommandSegment.ArgumentContribution contribute(MethodParametersAccessor parametersAccessor)
parametersAccessor - Copyright © 2019 lettuce.io. All rights reserved.