See: Description
| Package | Description |
|---|---|
| com.mgnt.lifecycle.management |
This package contains some small infrastructure that simplifies and automates working with Factories that provide
concrete implementations of an Interface.
|
| com.mgnt.lifecycle.management.backgroundrunner |
This package contains infrastructure that can run user implemented Task classes in a separate thread at configured
time interval.
|
| com.mgnt.lifecycle.management.httpclient | |
| com.mgnt.utils | |
| com.mgnt.utils.entities | |
| com.mgnt.utils.textutils |
MgntUtils is an open-source Java library that provides:
TextUtils.getStacktrace(), which accepts either a Throwable or a raw String. It removes framework noise (such as application server and library internals), making logs significantly more readable and reducing their size.
Filtering is configured via a predefined list of relevant package prefixes, allowing you to focus only on application-level code.
ThrowableString input (e.g., logs, remote services)TextUtils.parseStringToTimeInterval() and TextUtils.parseStringToDuration() convert strings like "5d", "4h", or "30m" directly into long milliseconds or java.time.Duration values, making time-based configuration far more maintainable than raw numeric values.
StringUnicodeEncoderDecoder class converts strings to Unicode escape sequences (e.g., Hello → \u0048\u0065\u006c\u006c\u006f) and back. This is useful for debugging encoding issues, handling special characters and emojis, and working with non-Latin scripts such as Hebrew, Arabic, Slavic languages, Chinese, and others.
Integer, Long, Double) without throwing NumberFormatException. Instead, they return a default value or null when parsing fails, avoiding boilerplate try-catch blocks.
Version type and VersionRange support, enabling easy comparison of software versions and checking whether a version falls within a given range. It also supports checking the intersection of version ranges.
WebUtils includes a method for chunked reading of HTTP request content that can auto-throttle to match the client's consumption speed.All other utilities in this library solve individual, well-defined problems. What follows is different in kind: it is a fundamental architectural pattern and by far the most significant part of this library. It is packaged as a lightweight micro-framework — two classes — that provides the infrastructure for a self-registering factory pattern. The library ships this infrastructure along with a complete, runnable example. The broader architectural pattern it enables — resolving an N × M extensibility problem across multiple data types and processing stages without modifying existing code — is not part of the library itself, but is documented in detail in Infrastructure for Extensible Multi-Stage Workflows Across Multiple Data Types and demonstrated in a separate companion project. This article should be considered required reading alongside this section.
The framework implementation is located in package com.mgnt.lifecycle.management. It provides infrastructure for factories whose components automatically register themselves during initialization — similar in spirit to an Inversion of Control container, but without the framework overhead and with no external dependencies. Implementation classes are factory-aware: this eliminates manual factory-population logic and centralized registration maps entirely — as long as a concrete implementation is instantiated, it becomes available through the factory.
The package-level Javadoc contains a detailed explanation of the design and a complete, runnable example included with the library source.
This Javadoc and the GitHub README provide a solid overview of what MgntUtils is and how to start using it. In addition, there is a series of articles about the library and its features that go deeper into each major utility and the Self-Populating Factory pattern. These articles should be treated as integral parts of the library's documentation and are especially useful for understanding architectural uses and advanced setups.
All articles are available in the Featured section of the author's LinkedIn profile:
https://www.linkedin.com/in/michael-gantman-9661521/details/featured/
Series-Overview Article:
Feature-Specific Deep Dives:
TextUtils.getStacktrace(). It explains how to use it for cleaner logs and how to configure package-based filtering to keep important stack frames and remove noise.
TextUtils.parseStringToTimeInterval() and TextUtils.parseStringToDuration() utilities in detail, showing how human-readable time-interval strings can replace hard-to-read numeric values in configuration and code.
StringUnicodeEncoderDecoder and shows how to convert strings to Unicode escape sequences and back. Especially useful when debugging encoding issues or working with non-Latin languages.
Architectural Design Pattern:
If you have any feedback, feel free to drop a note at michael_gantman@yahoo.com
The MIT License (MIT)
Copyright (c) 2018 - 2026 Michael Gantman
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.