Record Class Dialogue
java.lang.Object
java.lang.Record
io.github.kcajpanda.simpledialogue.dialogue.Dialogue
public record Dialogue(String id, Dialogue.NpcProfile npc, String start, Map<String, Dialogue.DialogueNode> nodes)
extends Record
Immutable representation of one loaded dialogue YAML file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Constructor Summary
ConstructorsConstructorDescriptionDialogue(String id, Dialogue.NpcProfile npc, String start, Map<String, Dialogue.DialogueNode> nodes) Creates an instance of aDialoguerecord 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.nodes()Returns the value of thenodesrecord component.npc()Returns the value of thenpcrecord component.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Dialogue
public Dialogue(String id, Dialogue.NpcProfile npc, String start, Map<String, Dialogue.DialogueNode> nodes) Creates an instance of aDialoguerecord class.- Parameters:
id- the value for theidrecord componentnpc- the value for thenpcrecord componentstart- the value for thestartrecord componentnodes- the value for thenodesrecord component
-
-
Method Details
-
startNode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
npc
Returns the value of thenpcrecord component.- Returns:
- the value of the
npcrecord component
-
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
nodes
Returns the value of thenodesrecord component.- Returns:
- the value of the
nodesrecord component
-