Class Namespaces

java.lang.Object
me.ahoo.cosid.spring.boot.starter.Namespaces

public final class Namespaces extends Object
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 Details

    • firstNotBlank

      public static String firstNotBlank(String... namespaces)
      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