Class KotlinFileSpecListStrategy
-
- All Implemented Interfaces:
-
io.toolisticon.kotlin.generation.WithTags,io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi,io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationStrategy,java.util.function.BiPredicate,kotlin.Comparable
public abstract class KotlinFileSpecListStrategy<CONTEXT extends KotlinCodeGenerationContext<CONTEXT>, INPUT extends Object> extends KotlinFileSpecIterableStrategy<CONTEXT, INPUT, KotlinFileSpecList>
Used to implement a io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationStrategy that will generate multiple io.toolisticon.kotlin.generation.spec.KotlinFileSpecs wrapped in KotlinFileSpecList.
Implementations should override the
invokefunction to call multiple KotlinFileSpecStrategys and collect the results.
-
-
Method Summary
Modifier and Type Method Description KClass<INPUT>getInputType()The type of the generic INPUT, used to filter relevant instances. abstract KotlinFileSpecListinvoke(CONTEXT context, INPUT input)Implements the actual strategy logic to generate a spec from a given input, using context information. Booleantest(CONTEXT context, Object input)Checks if this strategy should be applied. KotlinFileSpecListexecute(CONTEXT context, INPUT input)Checks if this strategy should be applied (using test) and then runs invoke. -
Methods inherited from class io.toolisticon.kotlin.generation.spi.strategy.KotlinCodeGenerationStrategyBase
getContextType, getName, getOrder, getSpecType, toString -
Methods inherited from class io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi
compareTo, tag -
Methods inherited from class java.util.function.BiPredicate
and, negate, or -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getInputType
KClass<INPUT> getInputType()
The type of the generic INPUT, used to filter relevant instances.
-
invoke
abstract KotlinFileSpecList invoke(CONTEXT context, INPUT input)
Implements the actual strategy logic to generate a spec from a given input, using context information.
- Parameters:
context- the context we are operating ininput- the concrete work item- Returns:
the generated spec
-
test
Boolean test(CONTEXT context, Object input)
Checks if this strategy should be applied.
- Parameters:
context- the context we are operating ininput- the concrete work item- Returns:
trueif this strategy should be applied,falseotherwise.
-
execute
KotlinFileSpecList execute(CONTEXT context, INPUT input)
- Parameters:
context- the context we are operating ininput- the concrete work item- Returns:
generated spec (or
nullif test wasfalse).
-
-
-
-