Class TimestampRangeArgumentValueValidator

    • Constructor Summary

      Constructors 
      Constructor Description
      TimestampRangeArgumentValueValidator​(java.util.Date oldestAllowedDate, java.util.Date mostRecentAllowedDate)
      Creates a new validator that will ensure that timestamp values are within the specified time range.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Date getMostRecentAllowedDate()
      Retrieves the most recent allowed date value that will be permitted by this validator.
      java.util.Date getOldestAllowedDate()
      Retrieves the oldest allowed date value that will be permitted by this validator.
      java.lang.String toString()
      Retrieves a string representation of this argument value validator.
      void toString​(java.lang.StringBuilder buffer)
      Appends a string representation of this argument value validator to the provided buffer.
      void validateArgumentValue​(Argument argument, java.lang.String valueString)
      Examines the value(s) assigned to the provided argument to determine whether they are acceptable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TimestampRangeArgumentValueValidator

        public TimestampRangeArgumentValueValidator​(@Nullable
                                                    java.util.Date oldestAllowedDate,
                                                    @Nullable
                                                    java.util.Date mostRecentAllowedDate)
        Creates a new validator that will ensure that timestamp values are within the specified time range.
        Parameters:
        oldestAllowedDate - The oldest timestamp that will be accepted by this validator. It may be null if any timestamp older than the provided mostRecentAllowedDate will be permitted.
        mostRecentAllowedDate - The most recent timestamp that will be accepted by this validator. It may be null if any timestamp more recent than the provided oldestAllowedDate will be permitted.
    • Method Detail

      • getOldestAllowedDate

        @Nullable
        public java.util.Date getOldestAllowedDate()
        Retrieves the oldest allowed date value that will be permitted by this validator.
        Returns:
        The oldest allowed date value that will be permitted by this validator, or null if any timestamp older than the most recent allowed date will be permitted.
      • getMostRecentAllowedDate

        @Nullable
        public java.util.Date getMostRecentAllowedDate()
        Retrieves the most recent allowed date value that will be permitted by this validator.
        Returns:
        The most recent allowed date value that will be permitted by this validator, or null if any timestamp newer than the oldest allowed date will be permitted.
      • validateArgumentValue

        public void validateArgumentValue​(@NotNull
                                          Argument argument,
                                          @NotNull
                                          java.lang.String valueString)
                                   throws ArgumentException
        Examines the value(s) assigned to the provided argument to determine whether they are acceptable.
        Specified by:
        validateArgumentValue in class ArgumentValueValidator
        Parameters:
        argument - The argument to which the value is being provided.
        valueString - The string representation of the value to be validated. This value will have already passed any normal validation performed by the argument.
        Throws:
        ArgumentException - If the provided value is determined to be unacceptable.
      • toString

        @NotNull
        public java.lang.String toString()
        Retrieves a string representation of this argument value validator.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this argument value validator.
      • toString

        public void toString​(@NotNull
                             java.lang.StringBuilder buffer)
        Appends a string representation of this argument value validator to the provided buffer.
        Parameters:
        buffer - The buffer to which the string representation should be appended.