Package org.gridgain.internal.mcp.config
Class ConfigResolver
java.lang.Object
org.gridgain.internal.mcp.config.ConfigResolver
Unified configuration resolver with 4-tier fallback:
1. Tool arguments (highest priority)
2. Environment variables
3. Default values (lowest priority)
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetBoolean(@Nullable Map<String, Object> arguments, String argKey, EnvironmentKey envKey) Resolve boolean value with 4-tier fallback.static booleangetBooleanFromEnv(EnvironmentKey envKey) Resolve boolean value from environment only.static intResolve integer value with 4-tier fallback.static intgetIntFromEnv(EnvironmentKey envKey) Resolve integer value from environment only.static longResolve long value with 4-tier fallback.static longgetLongFromEnv(EnvironmentKey envKey) Resolve long value from environment only.static @NotNull StringResolve string value (non-required).static @NotNull StringgetString(@Nullable Map<String, Object> arguments, String argKey, EnvironmentKey envKey, boolean required) Resolve string value with 4-tier fallback.static @NotNull StringgetStringFromEnv(EnvironmentKey envKey, boolean required) Resolve string value from environment only.
-
Method Details
-
getString
@NotNull public static @NotNull String getString(@Nullable @Nullable Map<String, Object> arguments, String argKey, EnvironmentKey envKey, boolean required) Resolve string value with 4-tier fallback.- Parameters:
arguments- Tool arguments map (can be null/empty)argKey- Argument keyenvKey- Environment variable keyrequired- Whether the value is required (throws if missing)- Returns:
- Resolved value
-
getString
@NotNull public static @NotNull String getString(@Nullable @Nullable Map<String, Object> arguments, String argKey, EnvironmentKey envKey) Resolve string value (non-required). -
getStringFromEnv
Resolve string value from environment only. -
getInt
public static int getInt(@Nullable @Nullable Map<String, Object> arguments, String argKey, EnvironmentKey envKey) Resolve integer value with 4-tier fallback. -
getIntFromEnv
Resolve integer value from environment only. -
getLong
public static long getLong(@Nullable @Nullable Map<String, Object> arguments, String argKey, EnvironmentKey envKey) Resolve long value with 4-tier fallback. -
getLongFromEnv
Resolve long value from environment only. -
getBoolean
public static boolean getBoolean(@Nullable @Nullable Map<String, Object> arguments, String argKey, EnvironmentKey envKey) Resolve boolean value with 4-tier fallback. -
getBooleanFromEnv
Resolve boolean value from environment only.
-