Record Class LinkCreationState

java.lang.Object
java.lang.Record
lu.kbra.modelizer_next.ui.canvas.datastruct.LinkCreationState
Record Components:
sourceType - type value to use
classId - id of the class to look up or modify
fieldId - id of the field to look up or modify
commentId - id of the comment to look up or modify
linkId - id of the link to look up or modify

public record LinkCreationState(SelectedElement.SelectedType sourceType, String classId, String fieldId, String commentId, String linkId) extends Record
State kept while the user creates a new link with the mouse.
  • Constructor Details

    • LinkCreationState

      public LinkCreationState(SelectedElement.SelectedType sourceType, String classId, String fieldId, String commentId, String linkId)
      Creates an instance of a LinkCreationState record class.
      Parameters:
      sourceType - the value for the sourceType record component
      classId - the value for the classId record component
      fieldId - the value for the fieldId record component
      commentId - the value for the commentId record component
      linkId - the value for the linkId record component
  • Method Details

    • fromSelection

      public static LinkCreationState fromSelection(SelectedElement selection)
      Creates a value from the supplied selection.
      Parameters:
      selection - selection state to read or update
      Returns:
      the from selection result
    • toSelectedElement

      public SelectedElement toSelectedElement()
      Converts the input to a selected element on the active canvas.
      Returns:
      the to selected element result
    • 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.
    • sourceType

      public SelectedElement.SelectedType sourceType()
      Returns the value of the sourceType record component.
      Returns:
      the value of the sourceType record component
    • classId

      public String classId()
      Returns the value of the classId record component.
      Returns:
      the value of the classId record component
    • fieldId

      public String fieldId()
      Returns the value of the fieldId record component.
      Returns:
      the value of the fieldId record component
    • commentId

      public String commentId()
      Returns the value of the commentId record component.
      Returns:
      the value of the commentId record component
    • linkId

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