|
@@ -3,41 +3,46 @@ 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
|
|
9
|
10
|
/**
|
10
|
11
|
* @author leon on 06/12/2018.
|
11
|
12
|
*/
|
12
|
|
-public class Group<ChangeThisTypeRespectively,ChangeThisOneToo> extends AbstractGroup{
|
|
13
|
+public class Group<TypeOfId extends Serializable,TypeOfEntity extends IdentifiableInterface<TypeOfId>>
|
|
14
|
+ extends AbstractGroup<TypeOfId, TypeOfEntity>{
|
|
15
|
+ private List<TypeOfEntity> group = new ArrayList<>();
|
|
16
|
+
|
13
|
17
|
@Override
|
14
|
18
|
public Integer count() {
|
15
|
|
- return null;
|
|
19
|
+ return group.size();
|
16
|
20
|
}
|
17
|
21
|
|
18
|
22
|
@Override
|
19
|
|
- public void insert(IdentifiableInterface object) {
|
20
|
|
-
|
|
23
|
+ public void insert(TypeOfEntity object) {
|
|
24
|
+ group.add(object);
|
21
|
25
|
}
|
22
|
26
|
|
23
|
27
|
@Override
|
24
|
|
- public void delete(IdentifiableInterface object) {
|
|
28
|
+ public void delete(TypeOfEntity object) {
|
|
29
|
+ group.remove(object);
|
25
|
30
|
|
26
|
31
|
}
|
27
|
32
|
|
28
|
33
|
@Override
|
29
|
|
- public void delete(Serializable serializable) {
|
30
|
|
-
|
|
34
|
+ public void delete(TypeOfId serializable) {
|
|
35
|
+ group.remove(serializable);
|
31
|
36
|
}
|
32
|
37
|
|
33
|
38
|
@Override
|
34
|
|
- public Boolean has(IdentifiableInterface object) {
|
35
|
|
- return null;
|
|
39
|
+ public Boolean has(TypeOfEntity object) {
|
|
40
|
+ return group.contains(object);
|
36
|
41
|
}
|
37
|
42
|
|
38
|
43
|
@Override
|
39
|
|
- public Boolean has(Serializable serializable) {
|
40
|
|
- return null;
|
|
44
|
+ public Boolean has(TypeOfId serializable) {
|
|
45
|
+ return group.contains(serializable);
|
41
|
46
|
}
|
42
|
47
|
|
43
|
48
|
@Override
|