Class ParameterConverter

java.lang.Object
net.simplace.sim.wrapper.rest.util.ParameterConverter

public final class ParameterConverter extends Object
Converts parameters from the JSON representation of the REST API into the form expected by SimplaceWrapper.
  • Method Details

    • toParameterMap

      public static Object[][] toParameterMap(Map<String,Object> aParameters)
      SimplaceWrapper#prepareSession/createSimulation/setSimulationValues expect an Object[][] of the form {{"vLUE", 3.2}, {"vSLA", 0.023}}. Via JSON the parameters arrive as a plain object {"vLUE": 3.2, "vSLA": 0.023} - this method converts between the two.
      Parameters:
      aParameters - parameters as map from name to value
      Returns:
      the parameters as array of name/value pairs, or null if aParameters is null or empty (the wrapper methods treat null as "no parameters" - an empty array is not the same!)