Class RatingValue

java.lang.Object
energy.trolie.client.model.common.RatingValue

public class RatingValue extends Object

Representation of a rating value, given the various units that are possible under the TROLIE specification.

In most cases, users may be able to assume the units used for ratings in a particular exchange. For example, ISO New England, SPP and MISO all normalize ratings to MVA. However, if this is not the case, the rating units are introspectable. Clients may wish to write defensive code as appropriate to the actual units of a given exchange.

  • Method Details

    • ofMappedJson

      public static RatingValue ofMappedJson(Map<String,Float> values)
      Construct from raw Json
      Parameters:
      values - map representing a JSON map as defined in the TROLIE specification
      Returns:
      new instance
    • fromMva

      public static RatingValue fromMva(float mva)
      Construct from an MVA value
      Parameters:
      mva - rating value in megavolt amperes
      Returns:
      new instance
    • fromAmps

      public static RatingValue fromAmps(float amps)
      Construct from an amps value
      Parameters:
      amps - rating value in amperes
      Returns:
      new instance
    • fromMwAndPf

      public static RatingValue fromMwAndPf(float mw, float pf)
      Construct from a megawatt and power factor ratio combination
      Parameters:
      mw - rating value in megawatts
      pf - assumed power factor ratio from 0 to 1
      Returns:
      new instance
    • getUnits

      public RatingUnits getUnits()
      Determines the units of this rating value
      Returns:
      the units used to represent this particular rating value. Will return null if the units are unknown to the SDK.
    • getMVA

      public Float getMVA()
      Gets the rating in MVA
      Returns:
      returns the rating in MVA if that is the units. Otherwise, returns null.
    • getAMPS

      public Float getAMPS()
      Gets the rating in amps
      Returns:
      returns the rating in amps if that is the units. Otherwise, returns null.
    • getMWAndPF

      public org.apache.commons.lang3.tuple.Pair<Float,Float> getMWAndPF()
      Gets the rating in a MW and PF pair
      Returns:
      returns the rating in MW and PF pair if that is the units. Otherwise, returns null.