org.simpleflatmapper.reflect.getter.IndexedIntArrayGetter Maven / Gradle / Ivy
package org.simpleflatmapper.reflect.getter;
import org.simpleflatmapper.reflect.Getter;
import org.simpleflatmapper.reflect.primitive.IntGetter;
public final class IndexedIntArrayGetter implements Getter, IntGetter {
private final int index;
public IndexedIntArrayGetter(int index) {
this.index = index;
}
@Override
public int getInt(int[] target) throws Exception {
return target[index];
}
@Override
public Integer get(int[] target) throws Exception {
return getInt(target);
}
}