2 İşlemeler

Yazar SHA1 Mesaj Tarih
  Seth 25bd382c57 buh 6 yıl önce
  Seth b6bef11dcc ActionFigurePerson 6 yıl önce

+ 16
- 11
src/main/java/com/zipcodewilmington/generic/group/Group.java Dosyayı Görüntüle

@@ -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

+ 5
- 4
src/main/java/com/zipcodewilmington/generic/identifiables/ActionFigure.java Dosyayı Görüntüle

@@ -5,14 +5,15 @@ import java.io.Serializable;
5 5
 /**
6 6
  * @author leon on 05/12/2018.
7 7
  */
8
-public class ActionFigure implements IdentifiableInterface {
8
+public class ActionFigure implements IdentifiableInterface<Long> {
9
+    private Long id;
9 10
 
10 11
     @Override
11
-    public Serializable getIdentity() {
12
-        return null;
12
+    public Long getIdentity() {
13
+        return id;
13 14
     }
14 15
 
15 16
     public Class getIdentityType() {
16
-        return null;
17
+        return Long.class;
17 18
     }
18 19
 }

+ 5
- 4
src/main/java/com/zipcodewilmington/generic/identifiables/Person.java Dosyayı Görüntüle

@@ -5,14 +5,15 @@ import java.io.Serializable;
5 5
 /**
6 6
  * @author leon on 05/12/2018.
7 7
  */
8
-public class Person implements IdentifiableInterface {
8
+public class Person implements IdentifiableInterface<String> {
9
+    private String id;
9 10
 
10 11
     @Override
11
-    public Serializable getIdentity() {
12
-        return null;
12
+    public String getIdentity() {
13
+        return id;
13 14
     }
14 15
 
15 16
     public Class getIdentityType() {
16
-        return null;
17
+        return String.class;
17 18
     }
18 19
 }