Developer Guide
Deep reference for every type in dmx-fun: design rationale, every combinator, composition patterns, and pitfalls to avoid.
Which type should I use?
Core types
Option<T>NullabilityA value that may or may not be present. The null-safe alternative.
Result<V, E>Error handlingEither a success value or a typed error. Models domain failures explicitly.
Try<V>Exception handlingWraps a computation that may throw. Turns exceptions into values.
Validated<E, A>ValidationLike Result but accumulates multiple errors instead of failing fast.
Either<L, R>Disjoint unionA neutral disjoint union with no success/failure semantics.
Lazy<T>Deferred computationA value computed at most once, on first access. Thread-safe memoization.
Tuple2/3/4Product typesTyped heterogeneous tuples. Named fields without a dedicated class.
NonEmptyList<T>CollectionsA list guaranteed to have at least one element at compile time.
NonEmptyMap<K,V>CollectionsA map guaranteed to have at least one entry at compile time. Insertion order preserved.
NonEmptySet<T>CollectionsA set guaranteed to have at least one element at compile time. No duplicates, insertion order preserved.
Guard<T>ValidationA composable, named predicate that produces a Validated result — the reusable building block for validation pipelines.
Resource<T>Resource managementA composable managed resource: acquire, use, and release with a guaranteed cleanup.
Accumulator<E,A>TracingA value paired with a side-channel accumulation (log, metrics, audit trail). The functional alternative to mutable shared state.
Checked interfacesInteropChecked variants of Function, Supplier, Consumer, Runnable, plus TriFunction/QuadFunction.
Integration modules
Optional artifacts — add only what you need. Each module declares its peer dependency as compileOnly so it never pulls in transitive dependencies unexpectedly.
JacksonJSONSerializers and deserializers for all dmx-fun types via the optional fun-jackson module.
AssertJTestingFluent AssertJ custom assertions for Option, Result, Try, Validated, and Tuple types.
SpringSpringTxResult and TxTry: programmatic transaction support that rolls back when Result.isError() or Try.isFailure(), without relying on exceptions.
QuarkusQuarkusTxResult and TxTry: CDI transaction support that rolls back when Result.isError() or Try.isFailure(). Declarative @TransactionalResult and @TransactionalTry via a CDI interceptor.
Resilience4JResilienceAdapters for Retry, CircuitBreaker, RateLimiter, and Bulkhead that return Try or Result instead of throwing exceptions.
MicrometerObservabilityAutomatic counters, timers, and failure metrics for Try and Result executions via DmxMicrometer.
Micrometer TracingObservabilityAutomatic distributed tracing spans for Try and Result executions via DmxTracing.
Micrometer ObservationObservabilityMetrics and distributed tracing spans for Try and Result executions — both signals from a single DmxObservation call.
Jakarta ValidationValidationDmxValidator bridges Jakarta Bean Validation with Validated<NonEmptyList<E>, A> so all constraint violations accumulate without throwing ConstraintViolationException.
Jakarta JSON-B + JAXBSerializationJsonbAdapter and XmlAdapter implementations for all dmx-fun types via the optional fun-jakarta-jaxb module.
HTTP ClientHTTPWraps java.net.http.HttpClient so every call returns Result<T, HttpError> with typed variants for 4xx, 5xx, timeouts, and network failures.
Contributing & Maintainers
Prerequisites, local build, code conventions, and how to open a PR.
All six GitHub Actions workflows: triggers, secrets, local equivalents.
Step-by-step guide for cutting a stable release.
Conventions and checklist for adding a new optional integration module.