com.global.api.utils.ReverseByteEnumMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of globalpayments-sdk Show documentation
Show all versions of globalpayments-sdk Show documentation
API for processing payments through Global Payments
package com.global.api.utils;
import com.global.api.entities.enums.IByteConstant;
import java.util.HashMap;
import java.util.Map;
public class ReverseByteEnumMap & IByteConstant> {
private Map map = new HashMap();
ReverseByteEnumMap(Class valueType) {
for(V v: valueType.getEnumConstants()) {
map.put(v.getByte(), v);
}
}
public V get(byte value) {
return map.get(value);
}
public static & IByteConstant> TResult parse(byte value, Class clazz) {
ReverseByteEnumMap mapper = new ReverseByteEnumMap(clazz);
return mapper.get(value);
}
}