Package io.micronaut.discovery.client
Class ClientUtil
java.lang.Object
io.micronaut.discovery.client.ClientUtil
Helpers to reduce redundant code between different Client implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalcPropertySourceNames(String prefix, Collection<String> activeNames, String separator) Calculates property source names.static StringresolveEnvironment(String fileName, Collection<String> activeNames) Resolves the environment from a property source name created bycalcPropertySourceNames(String, Collection, String).
-
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 configurationactiveNames- active environments which configurations can be created forseparator- The separator string- Returns:
- Set of names to be used for each PropertySource
-
resolveEnvironment
Resolves the environment from a property source name created bycalcPropertySourceNames(String, Collection, String).- Parameters:
fileName- The property source nameactiveNames- The active environments- Returns:
- The environment name
-