summaryrefslogtreecommitdiffstats
blob: db041b8f6a1e9ef771b15ee8ed07a8a01b418e98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 (JingleContentPayload jingleContentPayload : contents) {
			if (jingleContentPayload.getDescription(payload) != null) {
				return jingleContentPayload;
			}
		}
		return null;
	}
}