Class KotlinConstructorPropertySpecStrategy
-
- All Implemented Interfaces:
-
io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi
,io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationStrategy
,java.util.function.BiPredicate
,kotlin.Comparable
public abstract class KotlinConstructorPropertySpecStrategy<CONTEXT extends KotlinCodeGenerationContext<CONTEXT>, INPUT extends Object> extends KotlinCodeGenerationStrategyBase<CONTEXT, INPUT, KotlinConstructorPropertySpec>
Used to implement a io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationStrategy that will generate a KotlinConstructorPropertySpec.
-
-
Method Summary
Modifier and Type Method Description KClass<INPUT>
getInputType()
The type of the generic INPUT, used to filter relevant instances. abstract KotlinConstructorPropertySpec
invoke(CONTEXT context, INPUT input)
Implements the actual strategy logic to generate a spec from a given input, using context information. Boolean
test(CONTEXT context, Object input)
If true
, the spi instance is executed, else ignored.-
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.KotlinCodeGenerationStrategy
execute
-
Methods inherited from class io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi
compareTo
-
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 KotlinConstructorPropertySpec 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)
If
true
, the spi instance is executed, else ignored.- Parameters:
context
- the context we are operating ininput
- the concrete work item, for the check this is unbound and nullable, so we can check against calling with unsupported types.- Returns:
true
when the spi shoud be applied.
-
-
-
-