default <E extends Enum<E>> ToEnumNullable<ENTITY, E> asEnum(Class<E> enumClass) {
        return mapToEnumIfPresent(val -> {
            if (enumClass.isInstance(val)) {
                return enumClass.cast(val);
            } else throw new SpeedmentFieldException(format(
                "Expected field %s to be of type %s, but it was not.",
                enumClass.getName(), identifier()
            ));
        }, enumClass);
    }
Returns an {@link ToBooleanNullable} expression that has the value of
this field, casted to a particular {@code enum} class.

@param <E>        the enum type
@param enumClass  class of the enum to map to

@return    expression for this value after mapper has been applied

@since 3.1.0
runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/ReferenceField.java