/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.functional;

import java.util.function.IntUnaryOperator;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface IntCoFunction extends CoFunction<Integer, Integer> {

    @Override
    default Integer invert(Integer value) {
        return invert(value.intValue());
    }
    
    int invert(int value);
    
    static IntCoFunction identity() {
        return v -> v;
    }
    
    static IntCoFunction inverted(IntUnaryOperator f) {
        return v -> f.applyAsInt(v);
    }
    
    static IntUnaryOperator inverted(IntCoFunction f) {
        return v -> f.invert(v);
    }
    
}
