Seth 6 lat temu
rodzic
commit
25bd382c57

+ 11
- 7
src/main/java/com/zipcodewilmington/generic/group/Group.java Wyświetl plik

@@ -3,6 +3,7 @@ package com.zipcodewilmington.generic.group;
3 3
 import com.zipcodewilmington.generic.identifiables.IdentifiableInterface;
4 4
 
5 5
 import java.io.Serializable;
6
+import java.util.ArrayList;
6 7
 import java.util.List;
7 8
 import java.util.function.Predicate;
8 9
 
@@ -11,34 +12,37 @@ import java.util.function.Predicate;
11 12
  */
12 13
 public class Group<TypeOfId extends Serializable,TypeOfEntity extends IdentifiableInterface<TypeOfId>>
13 14
         extends AbstractGroup<TypeOfId, TypeOfEntity>{
15
+    private List<TypeOfEntity> group = new ArrayList<>();
16
+
14 17
     @Override
15 18
     public Integer count() {
16
-        return null;
19
+        return group.size();
17 20
     }
18 21
 
19 22
     @Override
20 23
     public void insert(TypeOfEntity object) {
21
-
24
+        group.add(object);
22 25
     }
23 26
 
24 27
     @Override
25
-    public void delete(TypeOfId object) {
28
+    public void delete(TypeOfEntity object) {
29
+        group.remove(object);
26 30
 
27 31
     }
28 32
 
29 33
     @Override
30
-    public void delete(TypeOfEntity serializable) {
31
-
34
+    public void delete(TypeOfId serializable) {
35
+        group.remove(serializable);
32 36
     }
33 37
 
34 38
     @Override
35 39
     public Boolean has(TypeOfEntity object) {
36
-        return null;
40
+        return group.contains(object);
37 41
     }
38 42
 
39 43
     @Override
40 44
     public Boolean has(TypeOfId serializable) {
41
-        return null;
45
+        return group.contains(serializable);
42 46
     }
43 47
 
44 48
     @Override