All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ebeaninternal.server.core.ClockService Maven / Gradle / Ivy

There is a newer version: 15.8.1
Show newest version
package io.ebeaninternal.server.core;

import java.time.Clock;

/**
 * Wraps the Clock such that we can change the Clock for testing purposes.
 */
public class ClockService {

  private Clock clock;

  public ClockService(Clock clock) {
    this.clock = clock;
  }

  /**
   * Change the clock for testing purposes.
   */
  public void setClock(Clock clock) {
    this.clock = clock;
  }

  /**
   * Return the Clock current timestamp in millis.
   */
  public long nowMillis() {
    return clock.millis();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy