All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tools4j.groovytables.FieldSetMethodViaDirectFieldAccess.groovy Maven / Gradle / Ivy

Go to download

A groovy API which allows you to create lists of objects using a table like grammar.

There is a newer version: 1.6
Show newest version
package org.tools4j.groovytables

import java.lang.reflect.Field

/**
 * User: ben
 * Date: 14/03/2016
 * Time: 6:36 AM
 */
class FieldSetMethodViaDirectFieldAccess implements FieldSetMethod {
    final Field field

    FieldSetMethodViaDirectFieldAccess(final Field field) {
        this.field = field
    }

    @Override
    void execute(final T object, final Object coercedArg) {
        field.set(object, coercedArg)
    }


    @Override
    public String toString() {
        return "DirectFieldAccess{$field.name}";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy