io.ayte.utility.predicate.kit.unary.capture.ArgumentCapturedPredicate Maven / Gradle / Ivy
package io.ayte.utility.predicate.kit.unary.capture;
import lombok.AccessLevel;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import java.util.function.BooleanSupplier;
import java.util.function.Predicate;
@ToString
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public class ArgumentCapturedPredicate implements BooleanSupplier {
private final Predicate delegate;
private final T value;
@Override
public boolean getAsBoolean() {
return delegate.test(value);
}
public static BooleanSupplier create(@NonNull Predicate delegate, T value) {
return new ArgumentCapturedPredicate<>(delegate, value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy