Class CounterValidators
java.lang.Object
com.guinetik.hexafun.examples.counter.CounterValidators
Validation functions for counter operations.
Each validator is a pure function: Input -> Result<Input> Can be composed/chained in the DSL.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Result<CounterInputs.AddInput>Validates that the amount in AddInput is within bounds [-100, 100].static Result<CounterInputs.AddInput>Validates that the counter in AddInput is not null.static Result<CounterInputs.DecrementInput>Validates that the counter in DecrementInput is not null.static Result<CounterInputs.IncrementInput>Validates that the counter in IncrementInput is not null.
-
Method Details
-
validateIncrement
public static Result<CounterInputs.IncrementInput> validateIncrement(CounterInputs.IncrementInput input) Validates that the counter in IncrementInput is not null. -
validateDecrement
public static Result<CounterInputs.DecrementInput> validateDecrement(CounterInputs.DecrementInput input) Validates that the counter in DecrementInput is not null. -
validateAddCounter
Validates that the counter in AddInput is not null. -
validateAddAmount
Validates that the amount in AddInput is within bounds [-100, 100].
-