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

io.cucumber.core.runtime.TimeServiceEventBus Maven / Gradle / Ivy

The newest version!
package io.cucumber.core.runtime;

import io.cucumber.core.eventbus.AbstractEventBus;

import java.time.Clock;
import java.time.Instant;
import java.util.UUID;
import java.util.function.Supplier;

public final class TimeServiceEventBus extends AbstractEventBus {

    private final Clock clock;
    private final Supplier idGenerator;

    public TimeServiceEventBus(Clock clock, Supplier idGenerator) {
        this.clock = clock;
        this.idGenerator = idGenerator;
    }

    @Override
    public Instant getInstant() {
        return clock.instant();
    }

    @Override
    public UUID generateId() {
        return idGenerator.get();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy