|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.indexdata.mkjsf.pazpar2.commands.CommandParameter
public class CommandParameter
Represents a Pazpar2 command parameter with a name, an operator, a simple value and/or one or more complex values (expressions).
Examples:
{name}{=}{value}
{name}{=}{value} AND {expr1=value1} AND {expr2=value2}
{name}{=}{expr1~value1},{expr2~value2}
Constructor Summary | |
---|---|
CommandParameter(String name)
|
|
CommandParameter(String name,
String operator,
Expression... expressions)
Instantiates a parameter with one or more expressions |
|
CommandParameter(String name,
String operator,
int value)
Instantiates a parameter with a numeric value |
|
CommandParameter(String name,
String operator,
String value)
Instantiates a parameter with a simple value |
|
CommandParameter(String name,
String operator,
String value,
Expression... expressions)
Instantiates a parameter with a simple value and one or more expressions |
Method Summary | |
---|---|
void |
addExpression(Expression expression)
Adds an expression to the end of the list of current expressions (if any) |
CommandParameter |
copy()
Clones the CommandParameter |
boolean |
equals(Object otherParameter)
|
String |
getEncodedQueryString()
Returns a URL encoded string of this parameter with name, operator, simple value and/or expressions |
List<Expression> |
getExpressions()
Returns a list of all current expressions |
List<Expression> |
getExpressions(String... expressionFields)
Returns expressions selected by their left-hand keys - as in 'expressionField=value'. |
String |
getName()
Returns the name (left of operator) of this parameter |
String |
getSimpleValue()
Returns the simple parameter value or null if no simple value was set for this parameter |
String |
getValueWithExpressions()
Returns the simple parameter value and/or any expressions, separated by 'AND' |
boolean |
hasExpressions()
Returns true if this parameter has expressions (complex values) |
boolean |
hasExpressions(String expressionField)
Returns true if this parameter has expressions of the given type, that is, expressions where the left-of-operator key equals 'expressionField' |
int |
hashCode()
|
boolean |
hasOperator()
|
boolean |
hasValue()
Returns true if this parameter has a simple value |
void |
removeExpression(Expression expression)
Removes a single expression identified by all its characteristics |
void |
removeExpressions(String... expressionFields)
Removes expressions selected by their left-of-operator fields/keys - as in 'expressionField=value'. |
void |
removeExpressionsAfter(Expression expression,
String... expressionFields)
Removes all expressions that appear after the provided expression and that have the given keys to the left of their operators - as in 'expressionField=value'. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CommandParameter(String name)
public CommandParameter(String name, String operator, String value, Expression... expressions)
name
- operator
- value
- expressions
- public CommandParameter(String name, String operator, Expression... expressions)
name
- operator
- expressions
- public CommandParameter(String name, String operator, String value)
name
- operator
- value
- public CommandParameter(String name, String operator, int value)
name
- operator
- value
- Method Detail |
---|
public String getName()
public List<Expression> getExpressions()
public List<Expression> getExpressions(String... expressionFields)
If the parameter has expressions expr1=x,expr2=y,expr3=z,expr1=u then invoking this method with {"expr1","expr3"} would return expr1=x,expr3=z,expr1=u but not expr2=y.
expressionFields
- The expression types to return
public void addExpression(Expression expression)
expression
- to addpublic void removeExpression(Expression expression)
expression
- to removepublic void removeExpressionsAfter(Expression expression, String... expressionFields)
This method is intended for bread crumb-like UI controls
expression
- The expression to use a starting point for removal (not inclusive)expressionFields
- The expression fields to removepublic void removeExpressions(String... expressionFields)
If the parameter has expressions expr1=x,expr2=y,expr3=z,expr1=u then invoking this method with {"expr1","expr3"} would remove expr1=x,expr3=z and expr1=u but leave expr2=y.
expressionFields
- The expression types (by field) to removepublic boolean hasOperator()
public boolean hasValue()
public boolean hasExpressions()
public boolean hasExpressions(String expressionField)
expressionField
- the type of expression to look for
public String getEncodedQueryString()
public String getSimpleValue()
public String getValueWithExpressions()
public boolean equals(Object otherParameter)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public CommandParameter copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |