Class DatesDSL


  • public class DatesDSL
    extends Object
    A Class for creating Date Sources that will produce Dates based on the number of milliseconds since epoch
    • Constructor Detail

      • DatesDSL

        public DatesDSL()
    • Method Detail

      • withMilliseconds

        public SolrGen<Date> withMilliseconds​(long millisecondsFromEpoch)
        Generates Dates inclusively bounded between January 1, 1970, 00:00:00 GMT and new Date(milliSecondsFromEpoch). The Source restricts Date generation, so that no Dates before 1970 can be created. The Source is weighted, so it is likely to produce new Date(millisecondsFromEpoch) one or more times.
        Parameters:
        millisecondsFromEpoch - the number of milliseconds from the epoch such that Dates are generated within this interval.
        Returns:
        a Source of type Date
      • withMillisecondsBetween

        public SolrGen<Date> withMillisecondsBetween​(long millisecondsFromEpochStartInclusive,
                                                     long millisecondsFromEpochEndInclusive)
        Generates Dates inclusively bounded between new Date(millisecondsFromEpochStartInclusive) and new Date(millisecondsFromEpochEndInclusive).
        Parameters:
        millisecondsFromEpochStartInclusive - the number of milliseconds from epoch for the desired older Date
        millisecondsFromEpochEndInclusive - the number of milliseconds from epoch for the desired more recent Date
        Returns:
        a source of Dates