Record Class PerspectiveScriptGrounding.TargetSnapshot
java.lang.Object
java.lang.Record
com.inductiveautomation.perspective.designer.ai.PerspectiveScriptGrounding.TargetSnapshot
- Record Components:
anchorTypeId- the type id of the first component the window edits, e.g.ia.input.button, ornullif unknown.targetCount- how many components the window writes the script to.
- Enclosing class:
PerspectiveScriptGrounding
public static record PerspectiveScriptGrounding.TargetSnapshot(@Nullable String anchorTypeId, int targetCount)
extends Record
What an editor window was opened on, captured once when the window is built — not when an
editor panel inside it is built, since those are created lazily, after the selection may
already have moved.
-
Constructor Summary
ConstructorsConstructorDescriptionTargetSnapshot(@Nullable String anchorTypeId, int targetCount) Creates an instance of aTargetSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the value of theanchorTypeIdrecord component.capture(ComponentSelection selection, List<String> componentPaths) The anchor type is taken fromselectiononly when the selection's anchor is the first ofcomponentPaths; otherwise it is left unknown, so a window opened on components other than the selected ones is never described with another component's type.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thetargetCountrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TargetSnapshot
Creates an instance of aTargetSnapshotrecord class.- Parameters:
anchorTypeId- the value for theanchorTypeIdrecord componenttargetCount- the value for thetargetCountrecord component
-
-
Method Details
-
capture
public static PerspectiveScriptGrounding.TargetSnapshot capture(ComponentSelection selection, List<String> componentPaths) The anchor type is taken fromselectiononly when the selection's anchor is the first ofcomponentPaths; otherwise it is left unknown, so a window opened on components other than the selected ones is never described with another component's type.- Parameters:
selection- the Designer selection at the moment the window opens.componentPaths- the components the window writes the script to.- Returns:
- the snapshot.
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
anchorTypeId
Returns the value of theanchorTypeIdrecord component.- Returns:
- the value of the
anchorTypeIdrecord component
-
targetCount
public int targetCount()Returns the value of thetargetCountrecord component.- Returns:
- the value of the
targetCountrecord component
-