summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/isode/stroke/jingle/Jingle.java')
-rw-r--r--src/com/isode/stroke/jingle/Jingle.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/com/isode/stroke/jingle/Jingle.java b/src/com/isode/stroke/jingle/Jingle.java
new file mode 100644
index 0000000..14dbb68
--- /dev/null
+++ b/src/com/isode/stroke/jingle/Jingle.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+/*
+ * Copyright (c) 2015 Tarun Gupta.
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+package com.isode.stroke.jingle;
+
+import com.isode.stroke.elements.JingleContentPayload;
+import com.isode.stroke.elements.Payload;
+import java.util.Vector;
+
+public class Jingle {
+
+ public <T extends Payload> JingleContentPayload getContentWithDescription(final Vector<JingleContentPayload> contents, T payload) {
+ for (int i = 0; i < contents.size(); ++i) {
+ if (contents.get(i).getDescription(payload) != null) {
+ return contents.get(i);
+ }
+ }
+ return null;
+ }
+}