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

package it.unimi.dsi.fastutil.shorts;

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

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