Class DateTimeGenerator

  • All Implemented Interfaces:
    Generator<java.util.Date>, NonNullGenerator<java.util.Date>, com.rapiddweller.common.Resettable, com.rapiddweller.common.ThreadAware, java.io.Closeable, java.lang.AutoCloseable

    public class DateTimeGenerator
    extends CompositeGenerator<java.util.Date>
    implements NonNullGenerator<java.util.Date>
    Creates DateTimes with separate date and time distribution characteristics.

    Created: 29.02.2008 18:19:55
    Since:
    0.5.0
    Author:
    Volker Bergmann
    • Constructor Detail

      • DateTimeGenerator

        public DateTimeGenerator()
        Instantiates a new Date time generator.
      • DateTimeGenerator

        public DateTimeGenerator​(java.util.Date minDate,
                                 java.util.Date maxDate,
                                 java.sql.Time minTime,
                                 java.sql.Time maxTime)
        Instantiates a new Date time generator.
        Parameters:
        minDate - the min date
        maxDate - the max date
        minTime - the min time
        maxTime - the max time
    • Method Detail

      • setMinDate

        public void setMinDate​(java.util.Date minDate)
        Sets min date.
        Parameters:
        minDate - the min date
      • setMaxDate

        public void setMaxDate​(java.util.Date maxDate)
        Sets max date.
        Parameters:
        maxDate - the max date
      • setDateGranularity

        public void setDateGranularity​(java.lang.String dateGranularity)
        Sets date granularity.
        Parameters:
        dateGranularity - the date granularity
      • setDateDistribution

        public void setDateDistribution​(Distribution distribution)
        Sets date distribution.
        Parameters:
        distribution - the distribution
      • setMinTime

        public void setMinTime​(java.sql.Time minTime)
        Sets min time.
        Parameters:
        minTime - the min time
      • setMaxTime

        public void setMaxTime​(java.sql.Time maxTime)
        Sets max time.
        Parameters:
        maxTime - the max time
      • setTimeGranularity

        public void setTimeGranularity​(java.sql.Time timeGranularity)
        Sets time granularity.
        Parameters:
        timeGranularity - the time granularity
      • setTimeDistribution

        public void setTimeDistribution​(Distribution distribution)
        Sets time distribution.
        Parameters:
        distribution - the distribution
      • generate

        public ProductWrapper<java.util.Date> generate​(ProductWrapper<java.util.Date> wrapper)
        Description copied from interface: Generator
        Returns an instance of the generic type E, using the ProductWrapper instance provided as argument. The wrapper may wrap a null value as a regular generator product. If the generator is not available (any more), it returns null instead of the ProductWrapper instance.
        Specified by:
        generate in interface Generator<java.util.Date>
        Parameters:
        wrapper - the wrapper
        Returns:
        the product wrapper