How to manage configurations without breaking deterministic?

We have configs in a static class and based on the environment variable returns different configurations. Mostly how long a workflow should wait.

package com.pipe17.temporal.order;

import java.time.Duration;
import java.util.HashMap;
import java.util.Map;

public class Config {

  private static Map<String, Object> developConfig;

  static {
    developConfig = new HashMap<>();
    developConfig.put("updateStatusFrequency", Duration.ofSeconds(30));
    developConfig.put("newStatusMaxDuration", Duration.ofMinutes(1));
    developConfig.put("readyForFulfillmentMaxDuration", Duration.ofMinutes(1));
    developConfig.put("fulfilledMaxDuration", Duration.ofMinutes(3));
  }

  private static Map<String, Object> masterConfig;

  static {
    masterConfig = new HashMap<>();
    masterConfig.put("updateStatusFrequency", Duration.ofMinutes(5));
    masterConfig.put("newStatusMaxDuration", Duration.ofHours(1));
    masterConfig.put("readyForFulfillmentMaxDuration", Duration.ofHours(1));
    masterConfig.put("fulfilledMaxDuration", Duration.ofDays(14));
  }

  public static Map<String, Object> getConfig() {

    String envName = System.getenv("env-name");
    if ("master".equals(envName)) {
      return masterConfig;
    }
    return developConfig;
  }
}

If we want to change the config values, how can we not break the deterministic for existing workflows? If this was saved in the db, we run an activity to read it then we do not have to worry about this right? But we are not ready to move these into db yet.

You can use SideEffect or an activity (local would be more efficient) to read the static variable. There is no need to use a DB for this.

Is this Go only?
I can only see SideEffect | Temporal
I found nothing else from the documentation

Most of the workflow APIs are static methods of the Workflow class in Java SDK. Here is the sideEffect.