We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a71a73 commit a0a6a1aCopy full SHA for a0a6a1a
src/main/java/myessentials/entities/Container.java
@@ -0,0 +1,35 @@
1
+package myessentials.entities;
2
+
3
+import com.google.common.collect.ImmutableList;
4
5
+import java.util.ArrayList;
6
+import java.util.List;
7
8
+public class Container<T> {
9
10
+ protected List<T> items = new ArrayList<T>();
11
12
+ public void add(T item) {
13
+ items.add(item);
14
+ }
15
16
+ public void remove(T item) {
17
+ items.remove(item);
18
19
20
+ public boolean contains(T item) {
21
+ return items.contains(item);
22
23
24
+ public List<T> asList() {
25
+ return ImmutableList.copyOf(items);
26
27
28
+ public int size() {
29
+ return items.size();
30
31
32
+ public boolean isEmpty() {
33
+ return items.isEmpty();
34
35
+}
0 commit comments