From aa6b58959109f908f3fadef17ee93277637d3058 Mon Sep 17 00:00:00 2001 From: Vyacheslav Boyko Date: Thu, 7 Jul 2022 23:30:46 +0300 Subject: [PATCH] fixing publication --- src/main/java/me/bvn13/fsm/Fsm.java | 21 ++++++-------------- src/main/java/me/bvn13/fsm/StateHandler.java | 2 +- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/main/java/me/bvn13/fsm/Fsm.java b/src/main/java/me/bvn13/fsm/Fsm.java index e2664cc..604d38e 100644 --- a/src/main/java/me/bvn13/fsm/Fsm.java +++ b/src/main/java/me/bvn13/fsm/Fsm.java @@ -17,6 +17,7 @@ import java.util.function.Supplier; *

* Final State Machine *

+ * *

* Each state machine must be prepared with: *

    @@ -25,7 +26,6 @@ import java.util.function.Supplier; *
  1. Intermediate states - optionally
  2. *
  3. All transitions needed
  4. *
- *

* *

* Each {@link State} may be specified with handlers: @@ -34,7 +34,6 @@ import java.util.function.Supplier; *

  • After handler - is called right before FSM changes FROM this state to another
  • *
  • Processor - the method to process events
  • * - *

    * *

    * Transition is the Rule providing FSM the possibility to change between states. @@ -46,12 +45,10 @@ import java.util.function.Supplier; *

  • Condition - optionally. If specified, the FSM will check the condition in order to check the possibility * to change from FROM State into TO State
  • * - *

    * *

    * Simple way to use it - to construct an inherited class specified with the type of events to be processed * during transitions. - *

    * *
      *  {@code
    @@ -79,35 +76,29 @@ import java.util.function.Supplier;
      *
      * 

    * Otherwise you are able to use Old syntax: - *

    * *
    - *  {@code
      *  NamedFsm namedFsm = new NamedFsm().setName("TEST FSM");
    - *  namedFsm.initState(new State("init") {
    - *      @Override
    + *  namedFsm.initState(new State<String>("init") {
      *      public void process(String event) {
      *          initStatedProcessed.set(true);
      *      }
      *  });
      *
    - *  namedFsm.addTransition("init", new State("first", true) {
    - *      @Override
    + *  namedFsm.addTransition("init", new State<String>("first", true) {
      *      public void process(String event) {
      *          firstStatedProcessed.set(true);
      *      }
      *  });
      *
    - *  namedFsm.addTransition("init", new State("another", true) {
    - *      @Override
    + *  namedFsm.addTransition("init", new State<String>("another", true) {
      *      public void process(String event) {
      *          anotherStatedProcessed.set(true);
      *      }
    - *  }, (fsm, event) -> false);
    + *  }, (fsm, event) -> false);
      *
      *  namedFsm.init();
    - *  }
    - * 
    * + *
    * {@link SimpleFsm} */ public class Fsm { diff --git a/src/main/java/me/bvn13/fsm/StateHandler.java b/src/main/java/me/bvn13/fsm/StateHandler.java index 38c2d72..d1cef68 100644 --- a/src/main/java/me/bvn13/fsm/StateHandler.java +++ b/src/main/java/me/bvn13/fsm/StateHandler.java @@ -2,7 +2,7 @@ package me.bvn13.fsm; /** * State handler - * @param + * @param class inherited from {@link Fsm} */ @FunctionalInterface public interface StateHandler {