/** * This static factory constructor allows the user to specify a time of * creation. * * @param object The object that will be wrapped. * @param timestamp Specifies the time this object was created in milliseconds * since the epoch. * @return A new WithTimestamp instance. * @param <U> The type that will be stored. */ public static <U> WithTimestamp<U> create( final U object, final long timestamp ) { return new WithTimestamp<U>(object, timestamp); }
/** * This static factory constructor returns a new WithTimestamp instance * with the default time set to the system time (measured in milliseconds * since the epoch) when the function is called. * * @param object The object that will be wrapped. * @return A new WithTimestamp instance. * @param <U> The type that will be stored. */ public static <U> WithTimestamp<U> create( final U object ) { final long time = System.currentTimeMillis(); return new WithTimestamp<U>(object, time); }