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

com.github.skjolber.packing.deadline.DelegateDeadlineCheckPackagerInterruptSupplier Maven / Gradle / Ivy

There is a newer version: 3.0.9
Show newest version
package com.github.skjolber.packing.deadline;

import java.util.function.BooleanSupplier;

public class DelegateDeadlineCheckPackagerInterruptSupplier implements PackagerInterruptSupplier {

	protected final BooleanSupplier delegate;
	protected final long deadline;

	public DelegateDeadlineCheckPackagerInterruptSupplier(long deadline, BooleanSupplier delegate) {
		super();
		this.deadline = deadline;
		this.delegate = delegate;
	}

	@Override
	public boolean getAsBoolean() {
		return delegate.getAsBoolean() || System.currentTimeMillis() > deadline;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy