[libbluray-devel] org.davic.net.Locator: Add equals()

hpi1 git at videolan.org
Wed Apr 13 10:26:20 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Apr  6 19:22:24 2016 +0300| [d3fd295c2f35ae2b47bdcd9770069dbc52c6132d] | committer: hpi1

org.davic.net.Locator: Add equals()

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=d3fd295c2f35ae2b47bdcd9770069dbc52c6132d
---

 src/libbluray/bdj/java/org/davic/net/Locator.java |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/libbluray/bdj/java/org/davic/net/Locator.java b/src/libbluray/bdj/java/org/davic/net/Locator.java
index 2d8dce7..cdc7d6b 100644
--- a/src/libbluray/bdj/java/org/davic/net/Locator.java
+++ b/src/libbluray/bdj/java/org/davic/net/Locator.java
@@ -35,5 +35,13 @@ public class Locator implements javax.tv.locator.Locator {
         return url;
     }
 
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof Locator) || url == null)
+            return false;
+
+        Locator locator = (Locator)obj;
+        return toExternalForm().equals(locator.toExternalForm());
+    }
+
     protected String url;
 }



More information about the libbluray-devel mailing list