class FieldToEnumImpl<ENTITY, V, E extends Enum<E>>
extends AbstractFieldMapper<ENTITY, V, E, ToEnum<ENTITY, E>, Function<V, E>>
implements FieldToEnum<ENTITY, V, E> {

    private final Class<E> enumClass;

    public FieldToEnumImpl(ReferenceField<ENTITY, ?, V> field,
                           Function<V, E> mapper,
                           Class<E> enumClass) {
        super(field, mapper);
        this.enumClass = requireNonNull(enumClass);
    }

    @Override
    public Class<E> enumClass() {
        return enumClass;
    }

    @Override
    public E apply(ENTITY entity) {<FILL_FUNCTION_BODY>}
}

        final V value = field.get(entity);
        if (value == null) return null;
        else return mapper.apply(value);
    
<methods>public ReferenceField<ENTITY,?,V> getField() ,public Function<V,E> getMapper() ,public FieldIsNotNullPredicate<ENTITY,E> isNotNull() ,public FieldIsNullPredicate<ENTITY,E> isNull() <variables>final non-sealed ReferenceField<ENTITY,?,V> field,final non-sealed Function<V,E> mapper