Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#807: Add new administrative area levels in the Address model #932

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/com/google/maps/model/AddressComponentType.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ public enum AddressComponentType {
* Not all nations exhibit these administrative levels.
*/
ADMINISTRATIVE_AREA_LEVEL_5("administrative_area_level_5"),
/**
* A fifth-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
ADMINISTRATIVE_AREA_LEVEL_6("administrative_area_level_6"),
/**
* A fifth-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
ADMINISTRATIVE_AREA_LEVEL_7("administrative_area_level_7"),

/** A commonly-used alternative name for the entity. */
COLLOQUIAL_AREA("colloquial_area"),
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/google/maps/model/AddressType.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ public enum AddressType implements UrlValue {
* Not all nations exhibit these administrative levels.
*/
ADMINISTRATIVE_AREA_LEVEL_5("administrative_area_level_5"),
/**
* A fifth-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
ADMINISTRATIVE_AREA_LEVEL_6("administrative_area_level_6"),
/**
* A fifth-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
ADMINISTRATIVE_AREA_LEVEL_7("administrative_area_level_7"),

/** A commonly-used alternative name for the entity. */
COLLOQUIAL_AREA("colloquial_area"),
Expand Down
11 changes: 7 additions & 4 deletions src/test/java/com/google/maps/model/EnumsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@Category(SmallTests.class)
public class EnumsTest {
@Test
public void testUnknown() throws Exception {
public void testUnknown() {
assertNotNull(AddressComponentType.UNKNOWN); // Does not implement UrlValue.

assertCannotGetUrlValue(AddressType.UNKNOWN);
Expand All @@ -43,7 +43,7 @@ public void testUnknown() throws Exception {

@Test
public void testCanonicalLiteralsForAddressType() {
Map<AddressType, String> addressTypeToLiteralMap = new HashMap<AddressType, String>();
Map<AddressType, String> addressTypeToLiteralMap = new HashMap<>();
// Short alias just to avoid line wrapping in the below code
Map<AddressType, String> m = addressTypeToLiteralMap;
m.put(AddressType.STREET_ADDRESS, "street_address");
Expand All @@ -57,6 +57,8 @@ public void testCanonicalLiteralsForAddressType() {
m.put(AddressType.ADMINISTRATIVE_AREA_LEVEL_3, "administrative_area_level_3");
m.put(AddressType.ADMINISTRATIVE_AREA_LEVEL_4, "administrative_area_level_4");
m.put(AddressType.ADMINISTRATIVE_AREA_LEVEL_5, "administrative_area_level_5");
m.put(AddressType.ADMINISTRATIVE_AREA_LEVEL_6, "administrative_area_level_6");
m.put(AddressType.ADMINISTRATIVE_AREA_LEVEL_7, "administrative_area_level_7");
m.put(AddressType.COLLOQUIAL_AREA, "colloquial_area");
m.put(AddressType.LOCALITY, "locality");
m.put(AddressType.WARD, "ward");
Expand Down Expand Up @@ -203,8 +205,7 @@ public void testCanonicalLiteralsForAddressType() {

@Test
public void testCanonicalLiteralsForAddressComponentType() {
Map<AddressComponentType, String> addressComponentTypeToLiteralMap =
new HashMap<AddressComponentType, String>();
Map<AddressComponentType, String> addressComponentTypeToLiteralMap = new HashMap<>();
// Short alias just to avoid line wrapping in the below code
Map<AddressComponentType, String> m = addressComponentTypeToLiteralMap;
m.put(AddressComponentType.STREET_ADDRESS, "street_address");
Expand All @@ -218,6 +219,8 @@ public void testCanonicalLiteralsForAddressComponentType() {
m.put(AddressComponentType.ADMINISTRATIVE_AREA_LEVEL_3, "administrative_area_level_3");
m.put(AddressComponentType.ADMINISTRATIVE_AREA_LEVEL_4, "administrative_area_level_4");
m.put(AddressComponentType.ADMINISTRATIVE_AREA_LEVEL_5, "administrative_area_level_5");
m.put(AddressComponentType.ADMINISTRATIVE_AREA_LEVEL_6, "administrative_area_level_6");
m.put(AddressComponentType.ADMINISTRATIVE_AREA_LEVEL_7, "administrative_area_level_7");
m.put(AddressComponentType.COLLOQUIAL_AREA, "colloquial_area");
m.put(AddressComponentType.LOCALITY, "locality");
m.put(AddressComponentType.WARD, "ward");
Expand Down