-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avniproject/avni-webapp#1225 - Introduced AddressLevelTypes collectio…
…n class. Moved logic support registration location types to Subject Type. Changed some exceptions to RuntimeException.
- Loading branch information
1 parent
65c3c7c
commit 13a6b5e
Showing
15 changed files
with
140 additions
and
58 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
25 changes: 25 additions & 0 deletions
25
avni-server-api/src/main/java/org/avni/server/domain/AddressLevelTypes.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,25 @@ | ||
package org.avni.server.domain; | ||
|
||
import java.util.*; | ||
|
||
public class AddressLevelTypes extends ArrayList<AddressLevelType> { | ||
public AddressLevelTypes(AddressLevelType ... addressLevelTypes) { | ||
super(Arrays.asList(addressLevelTypes)); | ||
} | ||
|
||
public AddressLevelTypes(List<AddressLevelType> addressLevelTypes) { | ||
super(addressLevelTypes); | ||
} | ||
|
||
public AddressLevelTypes getLowToHigh() { | ||
AddressLevelTypes temp = new AddressLevelTypes(this); | ||
temp.sort(Comparator.comparingDouble(AddressLevelType::getLevel)); | ||
return temp; | ||
} | ||
|
||
public AddressLevelTypes getHighToLow() { | ||
AddressLevelTypes temp = this.getLowToHigh(); | ||
Collections.reverse(temp); | ||
return temp; | ||
} | ||
} |
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
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
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.