Class DateFromParts

java.lang.Object
dev.morphia.aggregation.expressions.impls.Expression
dev.morphia.aggregation.expressions.impls.DateFromParts

public class DateFromParts extends Expression
Constructs and returns a Date object given the date’s constituent properties.
  • Method Details

    • day

      public DateFromParts day(Object 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
    • hour

      public DateFromParts hour(Object value)
      Can be any expression that evaluates to a number.

      Optional

      Parameters:
      value - the value to use
      Returns:
      this
    • isoDayOfWeek

      public DateFromParts isoDayOfWeek(Object 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(Object 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(Object 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(Object value)
      Can be any expression that evaluates to a number.

      Optional

      Parameters:
      value - the value to use
      Returns:
      this
    • minute

      public DateFromParts minute(Object value)
      Can be any expression that evaluates to a number.

      Optional

      Parameters:
      value - the value to use
      Returns:
      this
    • month

      public DateFromParts month(Object 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(Object value)
      Can be any expression that evaluates to a number.

      Optional

      Parameters:
      value - the value to use
      Returns:
      this
    • timezone

      public DateFromParts timezone(Object 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

      Parameters:
      value - the timezone
      Returns:
      this
    • year

      public DateFromParts year(Object 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