Quellcode durchsuchen

allow comparison of functionalStorage tags

kindlich vor 4 Jahren
Ursprung
Commit
ed7b56a39b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden

+ 18
- 0
JavaShared/src/main/java/org/openzen/zenscript/javashared/JavaFunctionalInterfaceStorageTag.java Datei anzeigen

@@ -6,6 +6,8 @@
6 6
 package org.openzen.zenscript.javashared;
7 7
 
8 8
 import java.lang.reflect.Method;
9
+import java.util.*;
10
+
9 11
 import org.openzen.zenscript.codemodel.type.storage.AutoStorageTag;
10 12
 import org.openzen.zenscript.codemodel.type.storage.BorrowStorageTag;
11 13
 import org.openzen.zenscript.codemodel.type.storage.SharedStorageTag;
@@ -57,4 +59,20 @@ public class JavaFunctionalInterfaceStorageTag implements StorageTag {
57 59
 	public boolean isImmutable() {
58 60
 		return true;
59 61
 	}
62
+    
63
+    @Override
64
+    public boolean equals(Object o) {
65
+        if(this == o)
66
+            return true;
67
+        if(o == null || getClass() != o.getClass())
68
+            return false;
69
+        
70
+        JavaFunctionalInterfaceStorageTag other = (JavaFunctionalInterfaceStorageTag) o;
71
+        return Objects.equals(functionalInterfaceMethod, other.functionalInterfaceMethod);
72
+    }
73
+    
74
+    @Override
75
+    public int hashCode() {
76
+        return functionalInterfaceMethod != null ? functionalInterfaceMethod.hashCode() : 0;
77
+    }
60 78
 }

Laden…
Abbrechen
Speichern