-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from TC4Y-777/dev
Change Head of Family in Family Page
- Loading branch information
Showing
41 changed files
with
2,008 additions
and
327 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
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
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
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
114 changes: 114 additions & 0 deletions
114
Tithe-Spring/src/main/java/com/tithe/entity/PersonBuilder.java
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,114 @@ | ||
/** | ||
* | ||
*/ | ||
package com.tithe.entity; | ||
|
||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
import com.tithe.model.GenderEnum; | ||
import com.tithe.model.OccupationSectorEnum; | ||
import com.tithe.utils.ObjectValidation; | ||
|
||
|
||
/** | ||
* @author Ashish Sam T George | ||
* | ||
*/ | ||
public class PersonBuilder { | ||
|
||
private Long personId; | ||
private String baptismName; | ||
private String personName; | ||
private FamilyEntity family; | ||
private RelationEntity relation; | ||
private GenderEnum gender; | ||
private LocalDate dob; | ||
private String phone; | ||
private List<TitheEntity> tithes; | ||
private Boolean moved = false; | ||
private List<EducationEntity> educations; | ||
private OccupationSectorEnum occupationSector; | ||
private List<OccupationEntity> occupations; | ||
private Boolean active = true; | ||
|
||
public PersonBuilder personId(Long personId) { | ||
this.personId = personId; | ||
return this; | ||
} | ||
|
||
public PersonBuilder baptismName(String baptismName) { | ||
this.baptismName = baptismName; | ||
return this; | ||
} | ||
|
||
public PersonBuilder personName(String personName) { | ||
this.personName = personName; | ||
return this; | ||
} | ||
|
||
public PersonBuilder family(FamilyEntity family) { | ||
this.family = family; | ||
return this; | ||
} | ||
|
||
public PersonBuilder relation(RelationEntity relation) { | ||
this.relation = relation; | ||
return this; | ||
} | ||
|
||
public PersonBuilder gender(GenderEnum gender) { | ||
this.gender = gender; | ||
return this; | ||
} | ||
|
||
public PersonBuilder dob(LocalDate dob) { | ||
this.dob = dob; | ||
return this; | ||
} | ||
|
||
public PersonBuilder phone(String phone) { | ||
this.phone = phone; | ||
return this; | ||
} | ||
|
||
// public PersonBuilder tithes(List<TitheEntity> tithes) { | ||
// this.tithes = tithes; | ||
// return this; | ||
// } | ||
|
||
public PersonBuilder moved(Boolean moved) { | ||
this.moved = moved; | ||
return this; | ||
} | ||
|
||
public PersonBuilder educations(List<EducationEntity> educations) { | ||
this.educations = educations; | ||
return this; | ||
} | ||
|
||
public PersonBuilder occupationSector(OccupationSectorEnum occupationSector) { | ||
this.occupationSector = occupationSector; | ||
return this; | ||
} | ||
|
||
public PersonBuilder occupations(List<OccupationEntity> occupations) { | ||
this.occupations = occupations; | ||
return this; | ||
} | ||
|
||
public PersonBuilder active(Boolean active) { | ||
this.active = active; | ||
return this; | ||
} | ||
|
||
public PersonEntity build() { | ||
PersonEntity person = new PersonEntity(personId, baptismName, personName, family, relation, gender, dob, phone, | ||
tithes, moved, educations, occupationSector, occupations, active); | ||
return person; | ||
} | ||
|
||
} |
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
Oops, something went wrong.