Skip to content

Commit 0cc8935

Browse files
committed
implementation of builder design pattern
1 parent 7f5d1be commit 0cc8935

File tree

11 files changed

+44
-0
lines changed

11 files changed

+44
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
package lk.ijse.dep8.orm.annotations;
22

3+
import java.lang.annotation.Annotation;
4+
import java.util.ArrayList;
5+
import java.util.List;
6+
7+
38
public class Bootstrap {
9+
private List<String> stringList=new ArrayList<>();
10+
11+
public Bootstrap append(String string){
12+
stringList.add(string);
13+
return this;
14+
}
15+
public String build(){
16+
return stringList.stream().reduce((old,current)->old+=current).get();
17+
}
418
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
package lk.ijse.dep8.orm.annotations;
22

3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
@Target(ElementType.TYPE)
9+
@Retention(RetentionPolicy.RUNTIME)
310
public @interface Entity {
11+
12+
String value() default "";
13+
14+
15+
416
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
package lk.ijse.dep8.orm.annotations;
22

3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
@Target(ElementType.FIELD)
9+
@Retention(RetentionPolicy.RUNTIME)
310
public @interface Id {
411
}
1.14 KB
Binary file not shown.
473 Bytes
Binary file not shown.
385 Bytes
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#Generated by Maven
2+
#Mon May 30 19:28:18 IST 2022
3+
version=1.0.0
4+
groupId=lk.ijse.dep8
5+
artifactId=simple-orm-framework
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lk/ijse/dep8/orm/annotations/Id.class
2+
lk/ijse/dep8/orm/annotations/Bootstrap.class
3+
lk/ijse/dep8/orm/annotations/Entity.class
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/home/chamals-pc/Desktop/IJSE DEP/phase-3/annotations/src/main/java/lk/ijse/dep8/orm/annotations/Bootstrap.java
2+
/home/chamals-pc/Desktop/IJSE DEP/phase-3/annotations/src/main/java/lk/ijse/dep8/orm/annotations/Entity.java
3+
/home/chamals-pc/Desktop/IJSE DEP/phase-3/annotations/src/main/java/lk/ijse/dep8/orm/annotations/Id.java

target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

Whitespace-only changes.

0 commit comments

Comments
 (0)