Class UnitParser

java.lang.Object
com.seeq.link.sdk.utilities.UnitParser

public class UnitParser extends Object
A cached wrapper around the /system/uoms API, allowing us to parse units using the same logic of com.seeq.appserver.data.scalar.ScalarUnits.smartParseUnit.
  • Field Details

  • Constructor Details

    • UnitParser

      public UnitParser(com.seeq.api.SystemApi systemApi)
  • Method Details

    • smartParseUnit

      @Nonnull public String smartParseUnit(@Nonnull String unit)
      Returns:
      the canonical version of the argument unit
      Throws:
      IllegalArgumentException - if the argument unit is unknown
    • smartParseUnitOrUnitless

      @Nonnull public String smartParseUnitOrUnitless(@Nonnull String unit)
      Returns:
      the canonical version of the argument unit or ONE_UOM if it is unknown