org.simpleflatmapper.reflect.getter.IndexedCharArrayGetter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-reflect Show documentation
Show all versions of sfm-reflect Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
The newest version!
package org.simpleflatmapper.reflect.getter;
import org.simpleflatmapper.reflect.Getter;
import org.simpleflatmapper.reflect.primitive.CharacterGetter;
public final class IndexedCharArrayGetter implements Getter, CharacterGetter {
private final int index;
public IndexedCharArrayGetter(int index) {
this.index = index;
}
@Override
public char getCharacter(char[] target) throws Exception {
return target[index];
}
@Override
public Character get(char[] target) throws Exception {
return getCharacter(target);
}
}