aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/entities/Contact.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-01-24 23:58:51 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-01-24 23:58:51 +0100
commitdf9dcb1060d44a719e2892446b62cde884a880cf (patch)
treeed3bf01c8f249162018b33460f81b52ac2f618fb /src/de/gultsch/chat/entities/Contact.java
parentb273390e26e1d28f6df01fb421d8554cb7588a58 (diff)
basic persistance layer. refactor some parts of the conversation activity
Diffstat (limited to 'src/de/gultsch/chat/entities/Contact.java')
-rw-r--r--src/de/gultsch/chat/entities/Contact.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/de/gultsch/chat/entities/Contact.java b/src/de/gultsch/chat/entities/Contact.java
new file mode 100644
index 00000000..30dfc05b
--- /dev/null
+++ b/src/de/gultsch/chat/entities/Contact.java
@@ -0,0 +1,35 @@
+package de.gultsch.chat.entities;
+
+import java.io.Serializable;
+
+import android.net.Uri;
+
+public class Contact implements Serializable {
+ private static final long serialVersionUID = -4570817093119419962L;
+ protected String display_name;
+ protected String jid;
+ protected String photo;
+
+ public Contact(String display_name, String jid, String photo) {
+ this.display_name = display_name;
+ this.jid = jid;
+ this.photo = photo;
+ }
+
+ public String getDisplayName() {
+ return this.display_name;
+ }
+
+ public Uri getProfilePhoto() {
+ if (photo == null) return null;
+ return Uri.parse(photo);
+ }
+
+ public String getJid() {
+ return this.jid;
+ }
+
+ public boolean match(String needle) {
+ return (jid.toLowerCase().contains(needle.toLowerCase()) || (display_name.toLowerCase().contains(needle.toLowerCase())));
+ }
+}