org.tools4j.groovytables.ExecutableConstructionMethodPrecursor.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.ToString
/**
* User: ben
* Date: 14/03/2016
* Time: 5:45 PM
*/
@ToString
class ExecutableConstructionMethodPrecursor implements ConstructionMethodPrecursor{
final Suitability suitability;
final Object[] rawArgs;
final Object[] coercedArgs;
final ExecutableConstructionMethod constructionMethod;
final static NOT_SUITABLE = new ExecutableConstructionMethodPrecursor(Suitability.NOT_SUITABLE, null, null, null);
ExecutableConstructionMethodPrecursor(final Suitability suitability, final Object[] rawArgs, final Object[] coercedArgs, final ExecutableConstructionMethod constructionMethod) {
this.suitability = suitability
this.rawArgs = rawArgs
this.coercedArgs = coercedArgs
this.constructionMethod = constructionMethod
}
TypeCoercionResult executeConstructionMethod() {
return new TypeCoercionResult(constructionMethod.construct(coercedArgs), suitability, constructionMethod);
}
}