awaeUtils is a collection of java utilities for use in various java and scala projects
Note: on github all maven releases are tagged, but only major releases are provided on github directly.
<dependency> <groupId>ch.awae</groupId> <artifactId>awaeUtils</artifactId> <version>LATEST</version> </dependency>
Listimplementation similar to the Scala
Listbuilt as a single linked stack with immutable elements
Callableas a super-type of
FailableFunctio0to allow for seamless integration with
serialpackage containing interface for different serialization schemes. These interfaces explicitly declare the methods required for customized Java serialization:
CustomDeserializationfor objects requiring a
CustomSerializationfor objects requiring a
SerializedThroughProxyfor objects that are serialized as another (proxy) object provided by a
SerializationProxyfor objects that serve as proxy objects in serialization and are resolved through a
readResolvemethod. If a class serves as its own proxy (i.e. after normal serialization the object will be replaced when deserializing it), the class can implement
SerializationProxyitself. There is no need to use a distinct proxy object.
IterativeRunner: A runnable that evaluates the same code block in an infinite loop that can be terminated by the code block itself or by interrupting the thread running the
Sourcesystem simplifying and unifying reading data from files, streams or a URL
PriorityQueueusing numeric priority parameters instead of natural ordering of the elements.
Shutdownhandler interacting with Java shutdown hooks that allows the definition of a specific shutdown sequence for shutdown hooks.
Logicsystem as an extension to the Java
Logicallows boolean operations to be done on these provider functions to enable complex behaviour. In essence any boolean composition that could be done by first evaluating multiple
BooleanSupplierinstances and then applying the boolean operations can be done on the
Logicinstances such that the complete expression can be evaluated by evaluating a single
Logicinstance. Some optimisation similar to classical short circuiting is done (i.e. once the result of an expression is fully known any additional providers are not evaluated).
Sequencefor composing runnables into a predefined interruptible sequence that can be executed asynchronously.
MachineCoreBuilderfor creation of event sequences, event funnels and arbitrary sequence event chains (event sequences for any permutation of a set of events)
MachineCoreBuildercan provide target states for a given origin state and event
CommandProcessoras a pre-built asynchronous processor that consumes commands from a
StateMachineand passes them on to a given
EventGeneratoras an asynchronous way to produce and issue events in a fixed rhythm. The events may either be fixed or supplied by a
StateMachinestates can be stored to and loaded from
StateMachinecan be extracted into raw Graphviz data
ch.awae.utils.statemachinepackage for creating asynchronous state machine clusters:
MachineCoreBuilderto create state machine cores
StateMachineBuilderto create state machine clusters