com.global.api.utils.ReverseByteEnumMap Maven / Gradle / Ivy
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);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy