// 
// Decompiled by Procyon v0.6.0
// 

package it.unimi.dsi.fastutil.bytes;

import java.util.Objects;
import it.unimi.dsi.fastutil.SafeMath;
import java.util.function.IntPredicate;
import java.util.function.Predicate;

@FunctionalInterface
public interface BytePredicate extends Predicate<Byte>, IntPredicate
{
    boolean test(final byte p0);
    
    @Deprecated
    default boolean test(final int t) {
        return this.test(SafeMath.safeIntToByte(t));
    }
    
    @Deprecated
    default boolean test(final Byte t) {
        return this.test((byte)t);
    }
    
    default BytePredicate and(final BytePredicate other) {
        Objects.requireNonNull(other);
        return t -> this.test(t) && other.test(t);
    }
    
    default BytePredicate and(final IntPredicate other) {
        BytePredicate other2;
        if (other instanceof BytePredicate) {
            other2 = (BytePredicate)other;
        }
        else {
            Objects.requireNonNull(other);
            other2 = other::test;
        }
        return this.and(other2);
    }
    
    @Deprecated
    default Predicate<Byte> and(final Predicate<? super Byte> other) {
        return super.and(other);
    }
    
    default BytePredicate negate() {
        return t -> !this.test(t);
    }
    
    default BytePredicate or(final BytePredicate other) {
        Objects.requireNonNull(other);
        return t -> this.test(t) || other.test(t);
    }
    
    default BytePredicate or(final IntPredicate other) {
        BytePredicate other2;
        if (other instanceof BytePredicate) {
            other2 = (BytePredicate)other;
        }
        else {
            Objects.requireNonNull(other);
            other2 = other::test;
        }
        return this.or(other2);
    }
    
    @Deprecated
    default Predicate<Byte> or(final Predicate<? super Byte> other) {
        return super.or(other);
    }
}
