Class ClientUtil

java.lang.Object
io.micronaut.discovery.client.ClientUtil

public class ClientUtil extends Object
Helpers to reduce redundant code between different Client implementations.
  • Constructor Details

    • ClientUtil

      public ClientUtil()
  • Method Details

    • calcPropertySourceNames

      public static Set<String> calcPropertySourceNames(String prefix, Collection<String> activeNames, String separator)
      Calculates property source names. This is used across several clients to make naming consistent.
      Parameters:
      prefix - fullName or prefix to the environment, or application specific configuration
      activeNames - active environments which configurations can be created for
      separator - The separator string
      Returns:
      Set of names to be used for each PropertySource
    • resolveEnvironment

      public static String resolveEnvironment(String fileName, Collection<String> activeNames)
      Resolves the environment from a property source name created by calcPropertySourceNames(String, Collection, String).
      Parameters:
      fileName - The property source name
      activeNames - The active environments
      Returns:
      The environment name