mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-10 19:38:47 +00:00
Location: Make sure type ANY cannot have ID.
This commit is contained in:
parent
80f0f30df5
commit
c396ebe508
1 changed files with 3 additions and 1 deletions
|
@ -56,7 +56,9 @@ public final class Location implements Serializable {
|
|||
|
||||
checkArgument(id == null || id.length() > 0, "ID cannot be the empty string");
|
||||
checkArgument(place == null || name != null, "place '%s' without name cannot exist", place);
|
||||
if (type == LocationType.COORD) {
|
||||
if (type == LocationType.ANY) {
|
||||
checkArgument(id == null, "type ANY cannot have ID");
|
||||
} else if (type == LocationType.COORD) {
|
||||
checkArgument(hasLocation(), "coordinates missing");
|
||||
checkArgument(place == null && name == null, "coordinates cannot have place or name");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue