Class Namespaces
java.lang.Object
me.ahoo.cosid.spring.boot.starter.Namespaces
Utility class for namespace operations in CosId configuration.
This class provides helper methods for working with namespaces, which are used to isolate ID generation contexts in distributed systems.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringfirstNotBlank(String... namespaces) Returns the first non-blank namespace from the provided arguments.
-
Method Details
-
firstNotBlank
Returns the first non-blank namespace from the provided arguments.This method iterates through the provided namespace strings and returns the first one that is not null, empty, or contains only whitespace characters. This is commonly used to determine the effective namespace by checking specific configuration first, then falling back to global defaults.
- Parameters:
namespaces- the namespace strings to check, in order of preference- Returns:
- the first non-blank namespace
- Throws:
IllegalArgumentException- if all provided namespaces are blank
-