org.simpleflatmapper.reflect.primitive.BoxedCharacterGetter Maven / Gradle / Ivy
package org.simpleflatmapper.reflect.primitive;
import org.simpleflatmapper.reflect.Getter;
public class BoxedCharacterGetter implements CharacterGetter, Getter {
private final Getter delegate;
public BoxedCharacterGetter(Getter delegate) {
this.delegate = delegate;
}
@Override
public char getCharacter(T target) throws Exception {
final Character value = get(target);
if (value != null) {
return value.charValue();
}
return 0;
}
@Override
public Character get(T target) throws Exception {
return delegate.get(target);
}
}