public static class StringOperators.Trim extends Object
AggregationExpression for $trim which removes whitespace or the specified characters from the
beginning and end of a string. | Modifier and Type | Method and Description |
|---|---|
protected List<Object> |
append(Object value) |
protected Map<String,Object> |
append(String key,
Object value) |
protected Map<String,Object> |
argumentMap()
Get the argument map.
|
protected static List<Field> |
asFields(String... fieldRefs) |
StringOperators.Trim |
chars(String chars)
Optional specify the character(s) to trim from the beginning.
|
StringOperators.Trim |
charsOf(AggregationExpression expression)
Optional specify the
AggregationExpression evaluating to the character sequence to trim from the
beginning. |
StringOperators.Trim |
charsOf(String fieldReference)
Optional specify the reference to the
field holding the character values to trim from the
beginning. |
protected boolean |
contains(Object key)
Check if the given key is available.
|
protected <T> T |
get(int index)
Get the value at a given index.
|
protected <T> T |
get(Object key)
Get the value for a given key.
|
protected String |
getMongoMethod() |
StringOperators.LTrim |
left()
Remove whitespace or the specified characters from the beginning of a string.
|
StringOperators.RTrim |
right()
Remove whitespace or the specified characters from the end of a string.
|
org.bson.Document |
toDocument(AggregationOperationContext context)
|
org.bson.Document |
toDocument(Object value,
AggregationOperationContext context) |
static StringOperators.Trim |
valueOf(AggregationExpression expression)
Creates new
StringOperators.Trim using the result of the provided AggregationExpression as input
value. |
static StringOperators.Trim |
valueOf(String fieldReference)
Creates new
StringOperators.Trim using the value of the provided fieldReference as input value. |
protected List<Object> |
values() |
public static StringOperators.Trim valueOf(String fieldReference)
StringOperators.Trim using the value of the provided fieldReference as input value.fieldReference - must not be null.StringOperators.LTrim.public static StringOperators.Trim valueOf(AggregationExpression expression)
StringOperators.Trim using the result of the provided AggregationExpression as input
value.expression - must not be null.StringOperators.Trim.public StringOperators.Trim chars(String chars)
chars - must not be null.StringOperators.Trim.public StringOperators.Trim charsOf(String fieldReference)
field holding the character values to trim from the
beginning.fieldReference - must not be null.StringOperators.Trim.public StringOperators.Trim charsOf(AggregationExpression expression)
AggregationExpression evaluating to the character sequence to trim from the
beginning.expression - must not be null.StringOperators.Trim.public StringOperators.LTrim left()
StringOperators.LTrim.public StringOperators.RTrim right()
StringOperators.RTrim.protected String getMongoMethod()
public org.bson.Document toDocument(AggregationOperationContext context)
AggregationExpressiontoDocument in interface AggregationExpressionpublic org.bson.Document toDocument(Object value, AggregationOperationContext context)
protected <T> T get(int index)
T - index - protected <T> T get(Object key)
T - key - protected boolean contains(Object key)
key - Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.