Class DateFromParts

    • Constructor Detail

      • DateFromParts

        public DateFromParts()
    • 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 class Expression
        Parameters:
        mapper - the mapper
        writer - the writer
        encoderContext - 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