Class DateFromParts
- java.lang.Object
-
- dev.morphia.aggregation.experimental.expressions.impls.Expression
-
- dev.morphia.aggregation.experimental.expressions.impls.DateFromParts
-
public class DateFromParts extends Expression
-
-
Constructor Summary
Constructors Constructor Description DateFromParts()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateFromParts
day(int value)
Optional.DateFromParts
day(Expression value)
Day of month.void
encode(Mapper mapper, org.bson.BsonWriter writer, org.bson.codecs.EncoderContext encoderContext)
DateFromParts
hour(int value)
OptionalDateFromParts
hour(Expression value)
Can be any expression that evaluates to a number.DateFromParts
isoDayOfWeek(int value)
Day of week (Monday 1 - Sunday 7).DateFromParts
isoDayOfWeek(Expression value)
Day of week (Monday 1 - Sunday 7).DateFromParts
isoWeek(int value)
Optional.DateFromParts
isoWeek(Expression value)
Week of year.DateFromParts
isoWeekYear(int value)
Required if not using year.DateFromParts
isoWeekYear(Expression value)
ISO Week Date Year.DateFromParts
millisecond(int value)
OptionalDateFromParts
millisecond(Expression value)
Can be any expression that evaluates to a number.DateFromParts
minute(int value)
OptionalDateFromParts
minute(Expression value)
Can be any expression that evaluates to a number.DateFromParts
month(int value)
Optional.DateFromParts
month(Expression value)
Can be any expression that evaluates to a number.DateFromParts
second(int value)
OptionalDateFromParts
second(Expression value)
Can be any expression that evaluates to a number.DateFromParts
timezone(Expression value)
Can be any expression that evaluates to a string whose value is either: an Olson Timezone Identifier, such as "Europe/London" or "America/New_York", or a UTC offset in the form: +/-[hh]:[mm], e.g.DateFromParts
timezone(String value)
Can be any string whose value is either: an Olson Timezone Identifier, such as "Europe/London" or "America/New_York", or a UTC offset in the form: +/-[hh]:[mm], e.g.DateFromParts
year(int value)
Calendar year.DateFromParts
year(Expression value)
Calendar year.-
Methods inherited from class dev.morphia.aggregation.experimental.expressions.impls.Expression
getOperation, getValue, toString
-
-
-
-
Method Detail
-
day
public DateFromParts day(int value)
Optional. Can only be used with year.- Parameters:
value
- the value to use- Returns:
- this
-
day
public DateFromParts day(Expression value)
Day of month. Can be any expression that evaluates to a number.Optional. Can only be used with year.
- Parameters:
value
- the value to use- Returns:
- this
-
encode
public void encode(Mapper mapper, org.bson.BsonWriter writer, org.bson.codecs.EncoderContext encoderContext)
- Overrides:
encode
in classExpression
- Parameters:
mapper
- the mapperwriter
- the writerencoderContext
- the context
-
hour
public DateFromParts hour(int value)
Optional- Parameters:
value
- the value to use- Returns:
- this
-
hour
public DateFromParts hour(Expression value)
Can be any expression that evaluates to a number.Optional
- Parameters:
value
- the value to use- Returns:
- this
-
isoDayOfWeek
public DateFromParts isoDayOfWeek(int value)
Day of week (Monday 1 - Sunday 7).- Parameters:
value
- the value to use- Returns:
- this
-
isoDayOfWeek
public DateFromParts isoDayOfWeek(Expression value)
Day of week (Monday 1 - Sunday 7). Can be any expression that evaluates to a number.- Parameters:
value
- the value to use- Returns:
- this
-
isoWeek
public DateFromParts isoWeek(int value)
Optional. Can only be used with isoWeekYear.- Parameters:
value
- the value to use- Returns:
- this
-
isoWeek
public DateFromParts isoWeek(Expression value)
Week of year. Can be any expression that evaluates to a number.Optional. Can only be used with isoWeekYear.
- Parameters:
value
- the value to use- Returns:
- this
-
isoWeekYear
public DateFromParts isoWeekYear(int value)
Required if not using year.- Parameters:
value
- the value to use- Returns:
- this
-
isoWeekYear
public DateFromParts isoWeekYear(Expression value)
ISO Week Date Year. Can be any expression that evaluates to a number.Required if not using year.
- Parameters:
value
- the value to use- Returns:
- this
-
millisecond
public DateFromParts millisecond(int value)
Optional- Parameters:
value
- the value to use- Returns:
- this
-
millisecond
public DateFromParts millisecond(Expression value)
Can be any expression that evaluates to a number.Optional
- Parameters:
value
- the value to use- Returns:
- this
-
minute
public DateFromParts minute(int value)
Optional- Parameters:
value
- the value to use- Returns:
- this
-
minute
public DateFromParts minute(Expression value)
Can be any expression that evaluates to a number.Optional
- Parameters:
value
- the value to use- Returns:
- this
-
month
public DateFromParts month(int value)
Optional. Can only be used with year.- Parameters:
value
- the value to use- Returns:
- this
-
month
public DateFromParts month(Expression value)
Can be any expression that evaluates to a number.Optional. Can only be used with year.
- Parameters:
value
- the value to use- Returns:
- this
-
second
public DateFromParts second(int value)
Optional- Parameters:
value
- the value to use- Returns:
- this
-
second
public DateFromParts second(Expression value)
Can be any expression that evaluates to a number.Optional
- Parameters:
value
- the value to use- Returns:
- this
-
timezone
public DateFromParts timezone(Expression value)
Can be any expression that evaluates to a string whose value is either:- an Olson Timezone Identifier, such as "Europe/London" or "America/New_York", or
- a UTC offset in the form:
- +/-[hh]:[mm], e.g. "+04:45", or
- +/-[hh][mm], e.g. "-0530", or
- +/-[hh], e.g. "+03".
Optional
-
timezone
public DateFromParts timezone(String value)
Can be any string whose value is either:- an Olson Timezone Identifier, such as "Europe/London" or "America/New_York", or
- a UTC offset in the form:
- +/-[hh]:[mm], e.g. "+04:45", or
- +/-[hh][mm], e.g. "-0530", or
- +/-[hh], e.g. "+03".
Optional
-
year
public DateFromParts year(int value)
Calendar year.Required if not using isoWeekYear.
- Parameters:
value
- the value to use- Returns:
- this
-
year
public DateFromParts year(Expression value)
Calendar year. Can be any expression that evaluates to a number.Required if not using isoWeekYear.
- Parameters:
value
- the value to use- Returns:
- this
-
-