Class CounterApp

java.lang.Object
com.guinetik.hexafun.examples.counter.CounterApp

public class CounterApp extends Object
Counter application demonstrating the improved HexaFun DSL.

Key improvements showcased:

  • Type-safe keys (UseCaseKey) instead of strings
  • Cleaner syntax: validate/handle instead of from/to
  • Implicit closure: no .and() chaining needed
  • Validator chaining: multiple .validate() calls
  • Constructor Details

    • CounterApp

      public CounterApp()
  • Method Details

    • increment

      public Result<Counter> increment(Counter counter)
      Increment a counter.
    • decrement

      public Result<Counter> decrement(Counter counter)
      Decrement a counter.
    • add

      public Result<Counter> add(Counter counter, int amount)
      Add amount to a counter.
    • getApp

      public HexaApp getApp()
      Get the underlying HexaApp for testing.
    • main

      public static void main(String[] args)