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

org.tools4j.groovytables.ValueCoercionResult.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 groovy.transform.EqualsAndHashCode

/**
 * User: ben
 * Date: 15/02/2016
 * Time: 5:38 PM
 */
@EqualsAndHashCode
public class ValueCoercionResult{
    final Suitability suitability;
    final T result;

    public static ValueCoercionResult NOT_SUITABLE = new ValueCoercionResult(null, Suitability.NOT_SUITABLE);

    ValueCoercionResult(final T result, final Suitability suitability) {
        this.result = result
        this.suitability = suitability
    }


    @Override
    public String toString() {
        final String resultType = result != null ? "[${result.class.simpleName}]": ""
        return "ValueCoercionResult{" +
                "suitability=" + suitability +
                ", result${resultType}=" + result +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy