-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a71a73
commit a0a6a1a
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package myessentials.entities; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Container<T> { | ||
|
||
protected List<T> items = new ArrayList<T>(); | ||
|
||
public void add(T item) { | ||
items.add(item); | ||
} | ||
|
||
public void remove(T item) { | ||
items.remove(item); | ||
} | ||
|
||
public boolean contains(T item) { | ||
return items.contains(item); | ||
} | ||
|
||
public List<T> asList() { | ||
return ImmutableList.copyOf(items); | ||
} | ||
|
||
public int size() { | ||
return items.size(); | ||
} | ||
|
||
public boolean isEmpty() { | ||
return items.isEmpty(); | ||
} | ||
} |