Record Class ControlBlockTarget

java.lang.Object
java.lang.Record
org.lfenergy.compas.sct.commons.dto.ControlBlockTarget
Record Components:
apRef - apRef
iedName - iedName : this field is "value" on TControlWithIEDName.IEDName
ldInst - ldInst
lnInst - lnInst
lnClass - lnClass
prefix - prefix
desc - desc : this field is only available on TClientLN

public record ControlBlockTarget(String apRef, String iedName, String ldInst, String lnInst, String lnClass, String prefix, String desc) extends Record
Record that hold the data for TClientLN and TControlWithIEDName.IEDName which have the same fields. It provides mapping methods "to" and "from" TClientLN and IEDName. It also provides comparison methods with TClientLN and IEDName.
  • Constructor Details

    • ControlBlockTarget

      public ControlBlockTarget(String apRef, String iedName, String ldInst, String lnInst, String lnClass, String prefix)
      "desc" field is only available on TClientLN, not on TControlWithIEDName.IEDName, so we provide a constructor without "desc" parameter
    • ControlBlockTarget

      public ControlBlockTarget(String apRef, String iedName, String ldInst, String lnInst, String lnClass, String prefix, String desc)
      Creates an instance of a ControlBlockTarget record class.
      Parameters:
      apRef - the value for the apRef record component
      iedName - the value for the iedName record component
      ldInst - the value for the ldInst record component
      lnInst - the value for the lnInst record component
      lnClass - the value for the lnClass record component
      prefix - the value for the prefix record component
      desc - the value for the desc record component
  • Method Details

    • toTClientLn

      public TClientLN toTClientLn()
      Map instance to TClientLN
      Returns:
      new instance of TClientLN
    • toIedName

      public TControlWithIEDName.IEDName toIedName()
      Map instance to TControlWithIEDName.IEDName
      Returns:
      new instance of TControlWithIEDName.IEDName
    • from

      public static ControlBlockTarget from(TClientLN tClientLN)
      Map TClientLN to ControlBlockTarget
      Parameters:
      tClientLN - tClientLN to map
      Returns:
      new instance of ControlBlockTarget
    • from

      public static ControlBlockTarget from(TControlWithIEDName.IEDName iedName)
      Map TControlWithIEDName.IEDName to ControlBlockTarget
      Parameters:
      iedName - iedName to map
      Returns:
      new instance of ControlBlockTarget
    • equalsIedName

      public boolean equalsIedName(TControlWithIEDName.IEDName iedName)
      Compare instance to a TControlWithIEDName.IEDName. desc value is ignored since TControlWithIEDName.IEDName does not have a desc attribute. Blank lnInst are considered equals. Blank prefix are considered equals.
      Parameters:
      iedName - iedName to compare
      Returns:
      true if all attributes of this instance (except desc) are equal to the attributes of TControlWithIEDName.IEDName (lnInst and prefix are compared using Utils#equalsOrBothBlank).
      See Also:
    • equalsTClientLn

      public boolean equalsTClientLn(TClientLN tClientLn)
      Compare instance to a TClientLN. Blank lnInst are considered equals. Blank prefix are considered equals. Blank desc are considered equals.
      Parameters:
      tClientLn - tClientLn to compare
      Returns:
      true if all attributes of this instance are equal to the attributes of TControlWithIEDName.IEDName (lnInst, prefix and desc are compared using Utils#equalsOrBothBlank).
      See Also:
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • apRef

      public String apRef()
      Returns the value of the apRef record component.
      Returns:
      the value of the apRef record component
    • iedName

      public String iedName()
      Returns the value of the iedName record component.
      Returns:
      the value of the iedName record component
    • ldInst

      public String ldInst()
      Returns the value of the ldInst record component.
      Returns:
      the value of the ldInst record component
    • lnInst

      public String lnInst()
      Returns the value of the lnInst record component.
      Returns:
      the value of the lnInst record component
    • lnClass

      public String lnClass()
      Returns the value of the lnClass record component.
      Returns:
      the value of the lnClass record component
    • prefix

      public String prefix()
      Returns the value of the prefix record component.
      Returns:
      the value of the prefix record component
    • desc

      public String desc()
      Returns the value of the desc record component.
      Returns:
      the value of the desc record component