aboutsummaryrefslogtreecommitdiff
path: root/src/main/model/html/TextNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/model/html/TextNode.java')
-rw-r--r--src/main/model/html/TextNode.java18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/main/model/html/TextNode.java b/src/main/model/html/TextNode.java
index 464180f..c50ce0f 100644
--- a/src/main/model/html/TextNode.java
+++ b/src/main/model/html/TextNode.java
@@ -3,23 +3,9 @@ package model.html;
/**
* This TextNode class represents raw text, with no nested tags.
*/
-public class TextNode implements Node {
- private String text = "";
-
- /**
- * EFFECTS: Creates a new TextNode from the provided String value.
- * MODIFIES: this
- */
- public TextNode(String text) {
- this.text = text;
- }
-
- public String getText() {
- return this.text;
- }
-
+public record TextNode(String text) implements Node {
// We implement this method for easy debugging.
public String getData() {
- return getText();
+ return text();
}
}