if (type.isEnum() && metadata.isAnnotationPresent(BoundNumber.class)) {
Map<Long, T> mapping = EnumUtils.getBoundEnumOptionIndex(type);
BoundNumber settings = metadata.getAnnotation(BoundNumber.class);
Expression<Integer, Resolver> sizeExpr = Expressions.createInteger(
context, settings.size());
return new EnumCodec<T>(type, mapping, sizeExpr, settings
.byteOrder());
} else {
return null;
}