You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/03/21 12:32:45 UTC

[GitHub] [netbeans] jkovalsky commented on a change in pull request #3266: Support for JEP 413: Snippet java docs

jkovalsky commented on a change in pull request #3266:
URL: https://github.com/apache/netbeans/pull/3266#discussion_r831052963



##########
File path: java/java.sourceui/src/org/netbeans/api/java/source/ui/snippet/MarkupTagAttribute.java
##########
@@ -0,0 +1,60 @@
+package org.netbeans.api.java.source.ui.snippet;
+
+import java.util.Objects;
+
+public class MarkupTagAttribute {
+
+    private final String name;
+    private final int nameStartPosition;
+    private final String value;
+    private final int valueStartPosition;
+
+    public MarkupTagAttribute(String name, int nameStartPosition, String value, int valueStartPosition) {
+        this.name = name;
+        this.nameStartPosition = nameStartPosition;
+        this.value = value;
+        this.valueStartPosition = valueStartPosition;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public int getNameStartPosition() {
+        return nameStartPosition;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public int getValueStartPosition() {
+        return valueStartPosition;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 7;
+        hash = 43 * hash + Objects.hashCode(this.name);
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final MarkupTagAttribute other = (MarkupTagAttribute) obj;
+        if (!Objects.equals(this.name, other.name)) {

Review comment:
       Can be simplified by just:
   `return Objects.equals(this.name, other.name)`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists