If you understood the concept of Actions, then States should be simple to grasp. This namespace contains interfaces that describe objects which can be in a certain state. The following interfaces are declared

The key difference to actions is that state methods return a plain boolean value.

There are semantic differences between the two states. An object is expected to be active and not disabled by default. Should an object implement both states, disablement should take precedence.

Just like with actions, states also come with a set of local and extension traits. There are no integration traits however. The only difference is that the local and extension methods return a boolean instead of a nullable exception. You can look over the traits for the active state here and the traits for the disabled state here.

Last updated