Byte retValue = null;
for (Annotation annotation : annotations) {
if (PodamByteValue.class.isAssignableFrom(annotation.getClass())) {
PodamByteValue intStrategy = (PodamByteValue) annotation;
String numValueStr = intStrategy.numValue();
if (null != numValueStr && !"".equals(numValueStr)) {
try {
retValue = Byte.valueOf(numValueStr);
} catch (NumberFormatException nfe) {
String errMsg = "The precise value: "
+ numValueStr
+ " cannot be converted to a byte type. An exception will be thrown.";
LOG.error(errMsg);
throw new IllegalArgumentException(errMsg, nfe);
}
} else {
byte minValue = intStrategy.minValue();
byte maxValue = intStrategy.maxValue();
// Sanity check
if (minValue > maxValue) {
maxValue = minValue;
}