package io.fotoapparat.parameter.selector;

import io.fotoapparat.parameter.range.Range;

/**
 * Selector functions for sensor sensitivity (ISO).
 */
public class SensorSensitivitySelectors {

    /**
     * @param iso the specified ISO value
     * @return {@link SelectorFunction} which selects the specified ISO value.
     *         If there is no specified value - selects default ISO value.
     */
    public static SelectorFunction<Range<Integer>, Integer> manualSensorSensitivity(final int iso) {
        return new SelectorFunction<Range<Integer>, Integer>() {
            @Override
            public Integer select(Range<Integer> sensorSensitivityCapability) {
                if(sensorSensitivityCapability.contains(iso)) {
                    return iso;
                } else {
                    return null;
                }
            }
        };
    }

    /**
     * @return {@link SelectorFunction} which selects highest ISO value.
     */
    public static SelectorFunction<Range<Integer>, Integer> highestSensorSensitivity() {
        return new SelectorFunction<Range<Integer>, Integer>() {
            @Override
            public Integer select(Range<Integer> sensorSensitivityCapability) {
                return sensorSensitivityCapability.highest();
            }
        };
    }

    /**
     * @return {@link SelectorFunction} which selects lowest ISO value.
     */
    public static SelectorFunction<Range<Integer>, Integer> lowestSensorSensitivity() {
        return new SelectorFunction<Range<Integer>, Integer>() {
            @Override
            public Integer select(Range<Integer> sensorSensitivityCapability) {
                return sensorSensitivityCapability.lowest();
            }
        };
    }

    /**
     * @return {@link SelectorFunction} which selects default ISO value.
     */
    public static SelectorFunction<Range<Integer>,Integer> automaticSensorSensitivity() {
        return new SelectorFunction<Range<Integer>, Integer>() {
            @Override
            public Integer select(Range<Integer> integerRange) {
                return null;
            }
        };
    }
}

@@ -1747,399 +1747,7 @@
    %7D
-%0A%0A    /**%0A     * @return %7B@link SelectorFunction%7D which selects default ISO value.%0A     */%0A    public static SelectorFunction%3CRange%3CInteger%3E,Integer%3E automaticSensorSensitivity() %7B%0A        return new SelectorFunction%3CRange%3CInteger%3E, Integer%3E() %7B%0A            @Override%0A            public Integer select(Range%3CInteger%3E integerRange) %7B%0A                return null;%0A            %7D%0A        %7D;%0A    %7D
 %0A%7D%0A

Remove useless SelectorFunction for ISO