-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMultiMapping_v1.java
More file actions
34 lines (32 loc) · 855 Bytes
/
MultiMapping_v1.java
File metadata and controls
34 lines (32 loc) · 855 Bytes
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
29
30
31
32
33
34
public class Test {
/**
* Gets the first inventory item matching with any of the provided ids.
*
* @param ids the ids to look for
* @return the first inventory item matching with any of the provided ids;
* otherwise <code>null</code>
*/
public static Item getItem(int... ids) {
Item[] items = getItems(ids);
if (items.length > 0) {
return items[0];
} else {
return null;
}
}
/**
* Gets the first inventory item matching with any of the provided ids.
*
* @param filter the filter to use
* @return the first inventory item matching with any of the provided ids;
* otherwise <code>null</code>
*/
public static Item getItem(final Filter<Item> filter) {
Item[] items = getItems(filter);
if (items.length > 0) {
return items[0];
} else {
return null;
}
}
}