// Path: src/main/java/io/taciturn/function/CheckedConsumer.java
// @FunctionalInterface
// public interface CheckedConsumer<T> {
// 
//     void accept(T t) throws Throwable;
// 
// }
// 
// Path: src/main/java/io/taciturn/function/CheckedFunction.java
// @FunctionalInterface
// public interface CheckedFunction<T, R> {
// 
//     R apply(T t) throws Throwable;
// 
// }
// 
// Path: src/main/java/io/taciturn/function/Rethrower.java
// @SuppressWarnings("WeakerAccess")
// public class Rethrower {
// 
//     public static <T> T rethrow(CheckedCallable<T> callable) {
//         return rethrowFunction(o -> callable.call(), null);
//     }
// 
//     public static <T> void rethrow(CheckedConsumer<T> consumer, T consumerParameter) {
//         rethrowFunction(o -> {
//             consumer.accept(o);
//             return (Void) null;
//         }, consumerParameter);
//     }
//     
//     public static <A, B> B rethrow(CheckedFunction<A, B> function, A functionParameter) {
//         return Rethrower.rethrowFunction(function, functionParameter);
//     }
//     
//     public static void rethrow(Throwable throwable) {
//         Rethrower.rethrowCheckedThrowable(throwable);
//     }
// 
//     @SuppressWarnings("ConstantConditions")
//     private static <A, B> B rethrowFunction(CheckedFunction<A, B> function, A functionParameter) {
//         try {
//             return function.apply(functionParameter);
//         } catch (Throwable e) {
//             Rethrower.rethrow(e);
//             throw new IllegalStateException(e);
//         }
//     }
// 
//     @SuppressWarnings({"unchecked", "ConstantConditions"})
//     private static <T extends Throwable> void rethrowCheckedThrowable(@NonNull Throwable throwable) throws T {
//         throw (T) throwable;
//     }
// 
// }
// 
// Path: src/main/java/io/taciturn/Utility.java
// public static <Item> ClassUtility<Item> $(Class<Item> object) {
//     return new ClassUtility<>(object);
// }


import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.function.Predicate;
import io.taciturn.function.CheckedConsumer;
import io.taciturn.function.CheckedFunction;
import io.taciturn.function.Rethrower;
import static io.taciturn.Utility.$;
        set(o -> o.setShort(parent, primitive));
    }

    /**
     * @see Field#set(Object, Object)
     * @throws IllegalAccessException This checked exception is thrown by the {@link Rethrower}.
     * @throws IllegalArgumentException
     */
    @SuppressWarnings("JavaDoc")
    public <T> void setObject(T object) {
        set(o -> o.set(parent, object));
    }

    private void set(CheckedConsumer<Field> consumer) {
        wrap(o -> {
            consumer.accept(o);
            return null;
        });
    }
    
    public void makeAccessible() {
        ifPresent(field -> $(field).filter(f -> !Modifier.isPublic(f.getModifiers()) ||
                                                Modifier.isFinal(f.getModifiers()) ||
                                                !Modifier.isPublic(f.getDeclaringClass().getModifiers()))
                                   .filter(f -> !f.isAccessible())
                                   .ifPresent(f -> f.setAccessible(true)));
    }

    private <T> T wrap(CheckedFunction<Field, T> function) {
        makeAccessible();
// Path: src/main/java/io/taciturn/function/CheckedConsumer.java
// @FunctionalInterface
// public interface CheckedConsumer<T> {
// 
//     void accept(T t) throws Throwable;
// 
// }
// 
// Path: src/main/java/io/taciturn/function/CheckedFunction.java
// @FunctionalInterface
// public interface CheckedFunction<T, R> {
// 
//     R apply(T t) throws Throwable;
// 
// }
// 
// Path: src/main/java/io/taciturn/function/Rethrower.java
// @SuppressWarnings("WeakerAccess")
// public class Rethrower {
// 
//     public static <T> T rethrow(CheckedCallable<T> callable) {
//         return rethrowFunction(o -> callable.call(), null);
//     }
// 
//     public static <T> void rethrow(CheckedConsumer<T> consumer, T consumerParameter) {
//         rethrowFunction(o -> {
//             consumer.accept(o);
//             return (Void) null;
//         }, consumerParameter);
//     }
//     
//     public static <A, B> B rethrow(CheckedFunction<A, B> function, A functionParameter) {
//         return Rethrower.rethrowFunction(function, functionParameter);
//     }
//     
//     public static void rethrow(Throwable throwable) {
//         Rethrower.rethrowCheckedThrowable(throwable);
//     }
// 
//     @SuppressWarnings("ConstantConditions")
//     private static <A, B> B rethrowFunction(CheckedFunction<A, B> function, A functionParameter) {
//         try {
//             return function.apply(functionParameter);
//         } catch (Throwable e) {
//             Rethrower.rethrow(e);
//             throw new IllegalStateException(e);
//         }
//     }
// 
//     @SuppressWarnings({"unchecked", "ConstantConditions"})
//     private static <T extends Throwable> void rethrowCheckedThrowable(@NonNull Throwable throwable) throws T {
//         throw (T) throwable;
//     }
// 
// }
// 
// Path: src/main/java/io/taciturn/Utility.java
// public static <Item> ClassUtility<Item> $(Class<Item> object) {
//     return new ClassUtility<>(object);
// }


// Path: src/main/java/io/taciturn/utility/FieldUtility.java
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.function.Predicate;
import io.taciturn.function.CheckedConsumer;
import io.taciturn.function.CheckedFunction;
import io.taciturn.function.Rethrower;
import static io.taciturn.Utility.$;

        set(o -> o.setShort(parent, primitive));
    }

    /**
     * @see Field#set(Object, Object)
     * @throws IllegalAccessException This checked exception is thrown by the {@link Rethrower}.
     * @throws IllegalArgumentException
     */
    @SuppressWarnings("JavaDoc")
    public <T> void setObject(T object) {
        set(o -> o.set(parent, object));
    }

    private void set(CheckedConsumer<Field> consumer) {
        wrap(o -> {
            consumer.accept(o);
            return null;
        });
    }
    
    public void makeAccessible() {
        ifPresent(field -> $(field).filter(f -> !Modifier.isPublic(f.getModifiers()) ||
                                                Modifier.isFinal(f.getModifiers()) ||
                                                !Modifier.isPublic(f.getDeclaringClass().getModifiers()))
                                   .filter(f -> !f.isAccessible())
                                   .ifPresent(f -> f.setAccessible(true)));
    }

    private <T> T wrap(CheckedFunction<Field, T> function) {
        makeAccessible();
        return map(o -> Rethrower.rethrow(function, o)).orElse(null);