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

package it.unimi.dsi.fastutil.objects;

import it.unimi.dsi.fastutil.bytes.Byte2ObjectFunction;
import it.unimi.dsi.fastutil.doubles.Double2ByteFunction;
import it.unimi.dsi.fastutil.doubles.Double2ReferenceFunction;
import it.unimi.dsi.fastutil.bytes.Byte2DoubleFunction;
import it.unimi.dsi.fastutil.floats.Float2ByteFunction;
import it.unimi.dsi.fastutil.floats.Float2ReferenceFunction;
import it.unimi.dsi.fastutil.bytes.Byte2FloatFunction;
import it.unimi.dsi.fastutil.chars.Char2ByteFunction;
import it.unimi.dsi.fastutil.chars.Char2ReferenceFunction;
import it.unimi.dsi.fastutil.bytes.Byte2CharFunction;
import it.unimi.dsi.fastutil.longs.Long2ByteFunction;
import it.unimi.dsi.fastutil.longs.Long2ReferenceFunction;
import it.unimi.dsi.fastutil.bytes.Byte2LongFunction;
import it.unimi.dsi.fastutil.ints.Int2ByteFunction;
import it.unimi.dsi.fastutil.ints.Int2ReferenceFunction;
import it.unimi.dsi.fastutil.bytes.Byte2IntFunction;
import it.unimi.dsi.fastutil.shorts.Short2ByteFunction;
import it.unimi.dsi.fastutil.shorts.Short2ReferenceFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ReferenceFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ByteFunction;
import java.util.function.ToIntFunction;
import it.unimi.dsi.fastutil.Function;

@FunctionalInterface
public interface Reference2ByteFunction<K> extends Function<K, Byte>, ToIntFunction<K>
{
    default int applyAsInt(final K operand) {
        return this.getByte(operand);
    }
    
    default byte put(final K key, final byte value) {
        throw new UnsupportedOperationException();
    }
    
    byte getByte(final Object p0);
    
    default byte getOrDefault(final Object key, final byte defaultValue) {
        final byte v;
        return ((v = this.getByte(key)) != this.defaultReturnValue() || this.containsKey(key)) ? v : defaultValue;
    }
    
    default byte removeByte(final Object key) {
        throw new UnsupportedOperationException();
    }
    
    @Deprecated
    default Byte put(final K key, final Byte value) {
        final K k = key;
        final boolean containsKey = this.containsKey(k);
        final byte v = this.put(k, (byte)value);
        return containsKey ? Byte.valueOf(v) : null;
    }
    
    @Deprecated
    default Byte get(final Object key) {
        final Object k = key;
        final byte v;
        return ((v = this.getByte(k)) != this.defaultReturnValue() || this.containsKey(k)) ? Byte.valueOf(v) : null;
    }
    
    @Deprecated
    default Byte getOrDefault(final Object key, final Byte defaultValue) {
        final Object k = key;
        final byte v = this.getByte(k);
        return (v != this.defaultReturnValue() || this.containsKey(k)) ? Byte.valueOf(v) : defaultValue;
    }
    
    @Deprecated
    default Byte remove(final Object key) {
        final Object k = key;
        return this.containsKey(k) ? Byte.valueOf(this.removeByte(k)) : null;
    }
    
    default void defaultReturnValue(final byte rv) {
        throw new UnsupportedOperationException();
    }
    
    default byte defaultReturnValue() {
        return 0;
    }
    
    @Deprecated
    default <T> java.util.function.Function<K, T> andThen(final java.util.function.Function<? super Byte, ? extends T> after) {
        return super.andThen((java.util.function.Function<? super Object, ? extends T>)after);
    }
    
    default Reference2ByteFunction<K> andThenByte(final Byte2ByteFunction after) {
        return k -> after.get(this.getByte(k));
    }
    
    default Byte2ByteFunction composeByte(final Byte2ReferenceFunction<K> before) {
        return k -> this.getByte(before.get(k));
    }
    
    default Reference2ShortFunction<K> andThenShort(final Byte2ShortFunction after) {
        return k -> after.get(this.getByte(k));
    }
    
    default Short2ByteFunction composeShort(final Short2ReferenceFunction<K> before) {
        return k -> this.getByte(before.get(k));
    }
    
    default Reference2IntFunction<K> andThenInt(final Byte2IntFunction after) {
        return k -> after.get(this.getByte(k));
    }
    
    default Int2ByteFunction composeInt(final Int2ReferenceFunction<K> before) {
        return k -> this.getByte(before.get(k));
    }
    
    default Reference2LongFunction<K> andThenLong(final Byte2LongFunction after) {
        return k -> after.get(this.getByte(k));
    }
    
    default Long2ByteFunction composeLong(final Long2ReferenceFunction<K> before) {
        return k -> this.getByte(before.get(k));
    }
    
    default Reference2CharFunction<K> andThenChar(final Byte2CharFunction after) {
        return k -> after.get(this.getByte(k));
    }
    
    default Char2ByteFunction composeChar(final Char2ReferenceFunction<K> before) {
        return k -> this.getByte(before.get(k));
    }
    
    default Reference2FloatFunction<K> andThenFloat(final Byte2FloatFunction after) {
        return k -> after.get(this.getByte(k));
    }
    
    default Float2ByteFunction composeFloat(final Float2ReferenceFunction<K> before) {
        return k -> this.getByte(before.get(k));
    }
    
    default Reference2DoubleFunction<K> andThenDouble(final Byte2DoubleFunction after) {
        return k -> after.get(this.getByte(k));
    }
    
    default Double2ByteFunction composeDouble(final Double2ReferenceFunction<K> before) {
        return k -> this.getByte(before.get(k));
    }
    
    default <T> Reference2ObjectFunction<K, T> andThenObject(final Byte2ObjectFunction<? extends T> after) {
        return (Reference2ObjectFunction<K, T>)(k -> after.get(this.getByte(k)));
    }
    
    default <T> Object2ByteFunction<T> composeObject(final Object2ReferenceFunction<? super T, ? extends K> before) {
        return k -> this.getByte(before.get(k));
    }
    
    default <T> Reference2ReferenceFunction<K, T> andThenReference(final Byte2ReferenceFunction<? extends T> after) {
        return (Reference2ReferenceFunction<K, T>)(k -> after.get(this.getByte(k)));
    }
    
    default <T> Reference2ByteFunction<T> composeReference(final Reference2ReferenceFunction<? super T, ? extends K> before) {
        return k -> this.getByte(before.get(k));
    }
}
