]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/Name.java
UPD: Use correct CSS class
[gigi.git] / src / org / cacert / gigi / Name.java
index 0c919dab4da4057a66c2437a6ad3763ece1ce2b0..fda8160c04a1fda560cfad5d6a387d11a6149944 100644 (file)
@@ -3,6 +3,7 @@ package org.cacert.gigi;
 import java.io.PrintWriter;
 import java.util.Map;
 
+import org.cacert.gigi.localisation.Language;
 import org.cacert.gigi.output.Outputable;
 
 public class Name implements Outputable {
@@ -34,6 +35,11 @@ public class Name implements Outputable {
         out.println("</span>");
     }
 
+    @Override
+    public String toString() {
+        return fname + " " + lname;
+    }
+
     @Override
     public boolean equals(Object obj) {
         if ( !(obj instanceof Name)) {
@@ -60,4 +66,11 @@ public class Name implements Outputable {
         return true;
 
     }
+
+    public boolean matches(String text) {
+        return text.equals(fname + " " + lname) || //
+                (mname != null && text.equals(fname + " " + mname + " " + lname)) || //
+                (suffix != null && text.equals(fname + " " + lname + " " + suffix)) || //
+                (mname != null && suffix != null && text.equals(fname + " " + mname + " " + lname + " " + suffix));
+    }
 }