Class SclConstructorHelper

java.lang.Object
org.lfenergy.compas.sct.commons.util.SclConstructorHelper

public final class SclConstructorHelper extends Object
A helper class that provides constructors to easily create instances of Jaxb classes generated by xjc. xjc only provides NoArgConstructors on generated classes. This utility class provides constructors with the most relevant attributes.
  • Method Details

    • newP

      public static TP newP(String type, String value)
      Create new instance of TP
      Parameters:
      type - type attribute
      value - value attribute
      Returns:
      new instance of TP initialized with the given parameters
    • newDurationInMilliSec

      public static TDurationInMilliSec newDurationInMilliSec(BigDecimal value, String unit, String multiplier)
      Create new instance of TDurationInMilliSec
      Parameters:
      value - value attribute
      unit - unit attribute
      multiplier - multiplier attribute
      Returns:
      new instance of TDurationInMilliSec initialized with the given parameters
    • newDurationInMilliSec

      public static TDurationInMilliSec newDurationInMilliSec(long value)
      Create new instance of TDurationInMilliSec with unit SECOND and multiplier MILLI.
      Parameters:
      value - value attribute
      Returns:
      new instance of TDurationInMilliSec initialized with the given parameters
      See Also:
    • newDurationInMilliSec

      public static TDurationInMilliSec newDurationInMilliSec(TDurationInMilliSec tDurationInMilliSec)
      Clone TDurationInMilliSec. The clone is independent of the tDurationInMilliSec because all fields are immutable.
      Parameters:
      tDurationInMilliSec - TDurationInMilliSec to clone
      Returns:
      new instance of TDurationInMilliSec initialized with the given parameters
      See Also:
    • newAddress

      public static TAddress newAddress(List<TP> listOfP)
      Create new instance of TAddress
      Parameters:
      listOfP - list of TP for setting the P attribute of the new TAddress
      Returns:
      new instance of TAddress initialized with the given parameters. P attribute of TAddress is a new list which contains the elements of listOfP (the given TP are not cloned).
    • newConnectedAp

      public static TConnectedAP newConnectedAp(String iedName, String apName)
      Create new instance of TConnectedAP
      Parameters:
      iedName - iedName attribute
      apName - apName attribute
      Returns:
      new instance of TConnectedAP initialized with the given parameters
    • newVal

      public static TVal newVal(String value, Long sGroup)
      Create new instance of TVal
      Parameters:
      value - value attribute
      sGroup - sGroup attribute (can be null)
      Returns:
      new instance of TVal initialized with the given parameters
    • newVal

      public static TVal newVal(String value)
      Create new instance of TVal with no sGroup
      Parameters:
      value - value attribute
      Returns:
      new instance of TVal initialized with the given parameters
    • newFcda

      public static TFCDA newFcda(String ldInst, String lnClass, String lnInst, String prefix, String doName, String daName, TFCEnum fc)