Class EInterval.Builder

  • Enclosing class:
    EInterval

    public static final class EInterval.Builder
    extends EField.Builder<EInterval>
    EInterval instances may be created only by using a Builder instance. A Builder instance is obtained by calling EInterval.builder() which returns a newly instantiated Builder instance. It is recommended that a new Builder instance be used to create an interval rather than re-using a builder instance to create multiple intervals.
    • Method Detail

      • validate

        protected Validator validate​(Validator problems)
        Checks if:
        1. the begin and end times and clusivity are set and
        2. begin time is either < or ≤ end time depending on clusivity settings.
        3. if begin time equals end time then both times must be inclusive.
        Overrides:
        validate in class EField.Builder<EInterval>
        Parameters:
        problems - add each detected problem to this validator.
        Returns:
        problems.
        See Also:
        Validator
      • beginTime

        public EInterval.Builder beginTime​(java.time.Instant beginTime)
        Sets interval begin time. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        beginTime - interval begin time.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if beginTime is null.
      • beginClusivity

        public EInterval.Builder beginClusivity​(EInterval.Clusivity clusivity)
        Sets interval begin time clusivity. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        clusivity - interval begin time clusivity.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if clusivity is null.
      • endTime

        public EInterval.Builder endTime​(java.time.Instant endTime)
        Sets the interval end time. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        endTime - interval end time.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if endTime is null.
      • endClusivity

        public EInterval.Builder endClusivity​(EInterval.Clusivity clusivity)
        Sets interval end time clusivity. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        clusivity - interval begin time clusivity.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if clusivity is null.