Return a copy of the internal variable map

@return Map of variables by name
337513
public Map<String, SDVariable> variableMap() {
        Map<String,SDVariable> ret = new LinkedHashMap<>();
        for(Variable v : variables.values()){
            ret.put(v.getName(), v.getVariable());
        }
        return ret;
    }
608394
public static <K, V> Map<K, V> copyOf(Map<K, V> map) {
        Preconditions.checkNotNull(map);
        return ImmutableMap.<K, V> builder().putAll(map).build();
    }
35182
public java.util.Map<java.lang.String, java.lang.String> getHttpHeadersMap() {
    return internalGetHttpHeaders().getMap();
  }
1099257
@Override
    public Map<String, String> getUserDefinedVariableDefaults() {
        HashMap<String, String> userDefinedVariables = new HashMap<String, String>();
        for (Map.Entry<String, ConfigVariable> entry : configVariables.entrySet()) {
            ConfigVariable var = entry.getValue();
            if (var.getValue() == null && var.getDefaultValue() != null) {
                userDefinedVariables.put(var.getName(), var.getDefaultValue());
            }
        }
        return userDefinedVariables;
    }
253555
private Map<String, GroovyRunner> getMap() {
        Map<String, GroovyRunner> map = runnerMap;
        if (map == null) {
            writeLock.lock();
            try {
                if ((map = runnerMap) == null) {
                    runnerMap = map = new LinkedHashMap<>();
                    load(null);
                }
            } finally {
                writeLock.unlock();
            }
        }
        return map;
    }
143648
@Trivial
    public final Map<String, String> getExecutionProperties() {
        TreeMap<String, String> copy = null;
        if (internalPropNames != null) {
            copy = new TreeMap<String, String>(threadContextDescriptor.getExecutionProperties());
            for (String name : internalPropNames)
                copy.remove(name);
        }
        return copy;
    }
1224562
public Set<String> getVariableNames()
    {
        final ImmutableSet.Builder<String> sb = ImmutableSet.builder();
        for (final Expression expr : expressions)
            for (final Variable var : expr.getVariables())
                sb.add(var.getName());
        return sb.build();
    }
919924
protected Map getAllVariables(){
        try{
            Iterator names = FreeMarkerTL.getEnvironment().getKnownVariableNames().iterator();
            Map vars = new HashMap();
            while (names.hasNext()) {
                Object name =names.next();
                vars.put(name, get(name.toString()));
            }
            return vars;
        }catch(Exception e){
            throw new ViewException(e);
        }
    }
1129782
public VariableNumMap getFirstVariables(int numVariables) {
    int numToCopy = Math.min(numVariables, nums.length);
    int[] newNums = Arrays.copyOf(nums, numToCopy);
    String[] newNames = Arrays.copyOf(names, numToCopy);
    Variable[] newVars = Arrays.copyOf(vars, numToCopy);
    return VariableNumMap.fromSortedArrays(newNums, newNames, newVars);
  }
677546
public VariableRef[] getVariableRefs() {
        Collection<VariableRef> allRefs = new ArrayList<VariableRef>();
        fillVariableRefs(allRefs, this);
        return allRefs.toArray(new VariableRef[allRefs.size()]);
    }
891902
public Map<String, ExpressionMapping> getInputOutputExpressionMappings() {
        Map<String, ExpressionMapping> map = new LinkedHashMap<String, ExpressionMapping>();
        for (ExpressionMapping em : _inputExpressionMappings) {
            String output = em.getOutput();
            if (output != null) {
                if (map.containsKey(output)) {
                    throw new IllegalArgumentException("duplicate input/output variable [" + output + "] not allowed");
                } else {
                    map.put(output, em);
                }
            }
        }
        return map;
    }
341294
@SuppressWarnings("unchecked")
    public Map<String, V> getData() {
        final TreeMap<String, V> result = new TreeMap<>(); // returned map must be sorted
        for (int i = 0; i < data.size(); i++) {
            // The Eclipse compiler does not need the typecast to V, but the Oracle compiler sure does.
            result.put(data.getKeyAt(i), (V) data.getValueAt(i));
        }
        return Collections.unmodifiableMap(result);
    }
701184
private void reusePreviouslyUsedVariableMap(SortedSet<Assignment> varsToRename) {
    // If prevUsedRenameMap had duplicate values then this pass would be
    // non-deterministic.
    // In such a case, the following will throw an IllegalArgumentException.
    checkNotNull(prevUsedRenameMap.getNewNameToOriginalNameMap());
    for (Assignment a : varsToRename) {
      String prevNewName = prevUsedRenameMap.lookupNewName(a.oldName);
      if (prevNewName == null || reservedNames.contains(prevNewName)) {
        continue;
      }

      if (a.isLocal
          || (!externNames.contains(a.oldName)
              && prevNewName.startsWith(prefix))) {
        reservedNames.add(prevNewName);
        finalizeNameAssignment(a, prevNewName);
      }
    }
  }
379469
@NonNull
    @Override
    public Map<String, Object> toMap() {
        synchronized (lock) {
            final Map<String, Object> result = new HashMap<>();
            for (String key : internalDict) {
                result.put(key, Fleece.toObject(getMValue(internalDict, key).asNative(internalDict)));
            }
            return result;
        }
    }
918484
public MapField<K, V> copy() {
        return new MapField<K, V>(converter, StorageMode.MAP, MapFieldLite.copy(getMap()), null);
    }
127692
@NonNull
  public static <K, V> Map<K, V> immutableCopyOf(@NonNull Map<K, V> map) {
    return Collections.unmodifiableMap(new LinkedHashMap<>(map));
  }
424562
public Map<String, String> getEnvironmentVariables() {
    final Props props = getJobProps();
    final Map<String, String> envMap = props.getMapByPrefix(ENV_PREFIX);
    return envMap;
  }