public static class DateOperators.DateFromParts extends DateOperators.TimezonedDateAggregationExpression implements DateOperators.DateParts<DateOperators.DateFromParts>
| Modifier and Type | Class and Description |
|---|---|
static interface |
DateOperators.DateFromParts.DateFromPartsWithYear |
| 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) |
protected boolean |
contains(Object key)
Check if the given key is available.
|
static DateOperators.DateFromParts.DateFromPartsWithYear |
dateFromParts()
Creates new
DateOperators.DateFromParts.DateFromPartsWithYear. |
DateOperators.DateFromParts |
day(Object day)
Set the day to the given value which must resolve to a calendar day in range
1 - 31. |
DateOperators.DateFromParts |
dayOf(AggregationExpression expression)
Set the day to the result of the given
expression. |
DateOperators.DateFromParts |
dayOf(String fieldReference)
Set the day to the value resolved by following the given
field reference. |
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() |
DateOperators.DateFromParts |
hour(Object hour)
Set the hour to the given value which must resolve to a value in range of
0 - 23. |
DateOperators.DateFromParts |
milliseconds(Object milliseconds)
Set the milliseconds to the given value which must resolve to a value in range
0 - 999. |
DateOperators.DateFromParts |
minute(Object minute)
Set the minute to the given value which must resolve to a value in range
0 - 59. |
DateOperators.DateFromParts |
month(Object month)
Set the month to the given value which must resolve to a calendar month in range
1 - 12. |
DateOperators.DateFromParts |
monthOf(AggregationExpression expression)
Set the month to the result of the given
expression. |
DateOperators.DateFromParts |
monthOf(String fieldReference)
Set the month to the value resolved by following the given
field reference. |
DateOperators.DateFromParts |
second(Object second)
Set the second to the given value which must resolve to a value in range
0 - 59. |
org.bson.Document |
toDocument(AggregationOperationContext context)
|
org.bson.Document |
toDocument(Object value,
AggregationOperationContext context) |
protected List<Object> |
values() |
DateOperators.DateFromParts |
withTimezone(DateOperators.Timezone timezone)
Optionally set the
DateOperators.Timezone to use. |
appendTimezone, hasTimezoneclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithourOf, hourOf, millisecondsOf, millisecondsOf, minuteOf, minuteOf, secondOf, secondOfpublic static DateOperators.DateFromParts.DateFromPartsWithYear dateFromParts()
DateOperators.DateFromParts.DateFromPartsWithYear.DateOperators.DateFromParts.DateFromPartsWithYear.public DateOperators.DateFromParts month(Object month)
1 - 12. Can
be a simple value, field reference or expression.month - must not be null.IllegalArgumentException - if given month is null.public DateOperators.DateFromParts monthOf(String fieldReference)
field reference.fieldReference - must not be null.IllegalArgumentException - if given fieldReference is null.public DateOperators.DateFromParts monthOf(AggregationExpression expression)
expression.expression - must not be null.IllegalArgumentException - if given expression is null.public DateOperators.DateFromParts day(Object day)
1 - 31. Can be a
simple value, field reference or expression.day - must not be null.IllegalArgumentException - if given day is null.public DateOperators.DateFromParts dayOf(String fieldReference)
field reference.fieldReference - must not be null.IllegalArgumentException - if given fieldReference is null.public DateOperators.DateFromParts dayOf(AggregationExpression expression)
expression.expression - must not be null.IllegalArgumentException - if given expression is null.public DateOperators.DateFromParts hour(Object hour)
DateOperators.DateParts0 - 23. Can be a
simple value, field reference or expression.hour in interface DateOperators.DateParts<DateOperators.DateFromParts>hour - must not be null.public DateOperators.DateFromParts minute(Object minute)
DateOperators.DateParts0 - 59. Can be a
simple value, field reference or expression.minute in interface DateOperators.DateParts<DateOperators.DateFromParts>minute - must not be null.public DateOperators.DateFromParts second(Object second)
DateOperators.DateParts0 - 59. Can be a
simple value, field reference or expression.second in interface DateOperators.DateParts<DateOperators.DateFromParts>second - must not be null.public DateOperators.DateFromParts milliseconds(Object milliseconds)
DateOperators.DateParts0 - 999. Can be
a simple value, field reference or expression.milliseconds in interface DateOperators.DateParts<DateOperators.DateFromParts>milliseconds - must not be null.public DateOperators.DateFromParts withTimezone(DateOperators.Timezone timezone)
DateOperators.Timezone to use. If not specified UTC is used.withTimezone in class DateOperators.TimezonedDateAggregationExpressiontimezone - must not be null. Consider DateOperators.Timezone.none() instead.DateOperators.DateFromParts.IllegalArgumentException - if given timezone is null.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.