Record Class EditorCommand
java.lang.Object
java.lang.Record
it.univr.di.cstnu.gui.EditorCommand
- Record Components:
id- stable, kebab-case identifier (e.g."stn-consistency")label- human-readable label (e.g."Consistency")requiresNodeParameter-truewhen this command needs aLabeledNodeargument (today: only the STN predecessor-subgraph command)
public record EditorCommand(@Nonnull String id, @Nonnull String label, boolean requiresNodeParameter)
extends Record
Declarative description of a check/transformation command offered by
EditorController
for a given network kind. This lets a future view build its buttons/menus without knowing
anything about the underlying checking algorithms: it only needs label() for the
button text and requiresNodeParameter() to know whether it must ask the user to
choose a node before calling EditorController.execute(EditorCommand, LabeledNode).- Author:
- posenato
-
Constructor Summary
ConstructorsConstructorDescriptionEditorCommand(String id, String label, boolean requiresNodeParameter) Creates an instance of aEditorCommandrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.label()Returns the value of thelabelrecord component.booleanReturns the value of therequiresNodeParameterrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EditorCommand
Creates an instance of aEditorCommandrecord class.- Parameters:
id- the value for theidrecord componentlabel- the value for thelabelrecord componentrequiresNodeParameter- the value for therequiresNodeParameterrecord component
-
-
Method Details
-
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. -
id
-
label
-
requiresNodeParameter
public boolean requiresNodeParameter()Returns the value of therequiresNodeParameterrecord component.- Returns:
- the value of the
requiresNodeParameterrecord component
-