
com.spikeify.converters.IntegerConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Simple ORM for Aerospike
package com.spikeify.converters;
import com.spikeify.Converter;
import com.spikeify.ConverterFactory;
import java.lang.reflect.Field;
public class IntegerConverter implements Converter, ConverterFactory {
@Override
public Converter init(Field field) {
return this;
}
public boolean canConvert(Class type) {
return Integer.class.isAssignableFrom(type) || int.class.isAssignableFrom(type);
}
public Integer fromProperty(Long property) {
return property == null ? null : property.intValue();
}
public Long fromField(Integer fieldValue) {
return Long.valueOf(fieldValue);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy