Class DateFromParts
- java.lang.Object
-
- dev.morphia.aggregation.expressions.impls.Expression
-
- dev.morphia.aggregation.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 DateFromPartsday(int value)Optional.DateFromPartsday(Expression value)Day of month.voidencode(Datastore datastore, BsonWriter writer, EncoderContext encoderContext)DateFromPartshour(int value)OptionalDateFromPartshour(Expression value)Can be any expression that evaluates to a number.DateFromPartsisoDayOfWeek(int value)Day of week (Monday 1 - Sunday 7).DateFromPartsisoDayOfWeek(Expression value)Day of week (Monday 1 - Sunday 7).DateFromPartsisoWeek(int value)Optional.DateFromPartsisoWeek(Expression value)Week of year.DateFromPartsisoWeekYear(int value)Required if not using year.DateFromPartsisoWeekYear(Expression value)ISO Week Date Year.DateFromPartsmillisecond(int value)OptionalDateFromPartsmillisecond(Expression value)Can be any expression that evaluates to a number.DateFromPartsminute(int value)OptionalDateFromPartsminute(Expression value)Can be any expression that evaluates to a number.DateFromPartsmonth(int value)Optional.DateFromPartsmonth(Expression value)Can be any expression that evaluates to a number.DateFromPartssecond(int value)OptionalDateFromPartssecond(Expression value)Can be any expression that evaluates to a number.DateFromPartstimezone(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".DateFromPartstimezone(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".DateFromPartsyear(int value)Calendar year.DateFromPartsyear(Expression value)Calendar year.-
Methods inherited from class dev.morphia.aggregation.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(Datastore datastore, BsonWriter writer, EncoderContext encoderContext)
- Overrides:
encodein classExpression- Parameters:
datastore- the datastorewriter- 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
-
-