/**
* Opening times of this branch office
*/
- private static List<OpeningTime> branchOpeningTimes;
+ private static List<OpeningTime> BRANCH_OPENING_TIMES;
/**
* Serial number
super();
// Is the opening times list there?
- if (null == branchOpeningTimes) {
+ if (null == BRANCH_OPENING_TIMES) {
// Init list
- branchOpeningTimes = new ArrayList<>(1);
+ BRANCH_OPENING_TIMES = new ArrayList<>(1);
}
}
final OpeningTime openingTime = this.createOpeningTimes();
// Is same found?
- if (this.isSameOpeningTimeFound(openingTime)) {
+ if (this.isOpeningTimeFound(openingTime)) {
// Yes then abort here
this.showFacesMessage("form-admin-add-branch-opening-time:openingStartDay", "ADMIN_OPENING_TIME_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N
return;
}
// Add to temporary list
- branchOpeningTimes.add(openingTime);
+ getBranchOpeningTimes().add(openingTime);
// Clear opening time fields
this.clearOpeningTime();
*/
@SuppressWarnings ("ReturnOfCollectionOrArrayField")
public List<OpeningTime> getBranchOpeningTimes () {
- return branchOpeningTimes;
+ return BRANCH_OPENING_TIMES;
}
/**
*/
@SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
public void setBranchOpeningTimes (final List<OpeningTime> branchOpeningTimes) {
- JobsAdminBranchOfficeActionWebRequestBean.branchOpeningTimes = branchOpeningTimes;
+ BRANCH_OPENING_TIMES = branchOpeningTimes;
}
/**
* @return Whether the address has been found
*/
private boolean isBranchOfficeCreatedBySameAddress (final BranchOffice branchOffice) {
- // Get full list from other bean
- final List<BranchOffice> branchOffices = this.branchOfficeListController.getAllBranchOffices();
-
// Default is not found
boolean isFound = false;
// Now check each entry
- for (final BranchOffice bo : branchOffices) {
+ for (final BranchOffice bo : this.branchOfficeListController.getAllBranchOffices()) {
// Is same address?
if (BranchOffices.isSameAddress(bo, branchOffice)) {
// Found one
* <p>
* @return Whether it has been added already
*/
- private boolean isSameOpeningTimeFound (final OpeningTime openingTime) {
+ private boolean isOpeningTimeFound (final OpeningTime openingTime) {
// Default is not found
boolean isFound = false;