src/main/java/com/feedzai/fos/impl/weka/utils/WekaUtils.java
@NotNull
    public static InstanceSetter[] instanceFields2ValueSetters(final List<? extends Attribute> instanceFields, final InstanceType type) throws FOSException {
        InstanceSetter[] instanceSetters = new InstanceSetter[instanceFields.size()];

        for (int idx = 0; idx < instanceFields.size(); idx++) {
            final Attribute att = instanceFields.get(idx);
            instanceSetters[idx] = new InstanceSetter() {
                @Override
                public void set(Instance instance, weka.core.Attribute attribute, Object value) throws FOSException {
                    instance.setValue(attribute, att.parseOrMissing(value));
                }
            };
        }
        return instanceSetters;
    }
@NotNull
    public static InstanceSetter[] instanceFields2ValueSetters(final List<? extends Attribute> instanceFields, final InstanceType type) throws FOSException {
        InstanceSetter[] instanceSetters = new InstanceSetter[instanceFields.size()];

        for (int idx = 0; idx < instanceFields.size(); idx++) {
            final Attribute att = instanceFields.get(idx);
            instanceSetters[idx] = new InstanceSetter() {
                @Override
                public void set(Instance instance, weka.core.Attribute attribute, Object value) throws FOSException {
                    instance.setValue(attribute, att.parseOrMissing(value));
                }
            };
        }
        return instanceSetters;
    }
@ NotNull public static InstanceSetter [ ] instanceFields2ValueSetters ( final List < ? extends Attribute > instanceFields , final InstanceType type ) throws FOSException { InstanceSetter [ ] instanceSetters = new InstanceSetter [ instanceFields . size ( ) ] ; for ( int idx = 0 ; idx < instanceFields . size ( ) ; idx ++ ) { final Attribute att = instanceFields . get ( idx ) ; instanceSetters [ idx ] = new InstanceSetter ( ) { @ Override public void set ( Instance instance , weka . core . Attribute attribute , Object value ) throws FOSException { instance . setValue ( attribute , att . parseOrMissing ( value ) ) ; } } ; } return instanceSetters ; }
Converts from <code>InstanceFields</code> to <code>InstanceSetters</code> (required for scorable manipulation).

@param instanceFields The instance fields for which to create the converters
@param type           The type of instance to handle.
@return an array of <code>InstanceSetter</code> with one <code>InstanceSetter</code> for each <code>InstanceField</code>.
Converts from <code > InstanceFields< / code > to <code > InstanceSetters< / code > ( required for scorable manipulation ) .