Record Class ArgumentLocation

java.lang.Object
java.lang.Record
org.yamcs.commanding.ArgumentLocation
Record Components:
path - the argument name, followed for members and elements by the path inside the value, for example x, activities, activities[1] or activities[1].tc
bitPosition - position in bits of the start of the encoded value (including any leading size tag)
bitSize - number of bits used to encode the value

public record ArgumentLocation(String path, int bitPosition, int bitSize) extends Record
Location of an argument value inside the binary of an encoded command.

The locations are recorded by the command encoder for each top level argument as well as for each member of an aggregate and each element of an array. They are relative to the start of the binary as produced by the encoder (i.e. before any change made by the command post-processor).

  • Constructor Details

    • ArgumentLocation

      public ArgumentLocation(String path, int bitPosition, int bitSize)
      Creates an instance of a ArgumentLocation record class.
      Parameters:
      path - the value for the path record component
      bitPosition - the value for the bitPosition record component
      bitSize - the value for the bitSize record component
  • Method Details

    • isByteAligned

      public boolean isByteAligned()
    • byteOffset

      public int byteOffset()
      Returns:
      the byte offset of the value; meaningful only if the value is byte aligned
    • byteLength

      public int byteLength()
      Returns:
      the size of the value in bytes; meaningful only if the value is byte aligned
    • toProto

      public Cmdhistory.ArgumentLocation toProto()
    • fromProto

      public static ArgumentLocation fromProto(Cmdhistory.ArgumentLocation loc)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • path

      public String path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • bitPosition

      public int bitPosition()
      Returns the value of the bitPosition record component.
      Returns:
      the value of the bitPosition record component
    • bitSize

      public int bitSize()
      Returns the value of the bitSize record component.
      Returns:
      the value of the bitSize record component