org.tools4j.groovytables.ValueCoercionResult.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of groovy-tables Show documentation
Show all versions of groovy-tables Show documentation
A groovy API which allows you to create lists of objects using a table like grammar.
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 +
'}';
}
}