@Test public void getDefaultNameReturnsNullIfNoLocationTypeIsAvailable() { String value = instance.getDefaultName(); assertThat(value, is(nullValue())); }
@JsonIgnore public String getDefaultName() { if (district != null) { return getDisplayName(LocationNames.LocationType.DISTRICT); } else if (settlement != null) { return getDisplayName(LocationNames.LocationType.SETTLEMENT); } else if (region != null) { return getDisplayName(LocationNames.LocationType.REGION); } else if (country != null) { return getDisplayName((LocationNames.LocationType.COUNTRY)); } else if (bloc != null) { return getDisplayName(LocationNames.LocationType.BLOC); } return null; }
PlaceName { @JsonIgnore public String getDefaultName() { if (district != null) { return getDisplayName(LocationNames.LocationType.DISTRICT); } else if (settlement != null) { return getDisplayName(LocationNames.LocationType.SETTLEMENT); } else if (region != null) { return getDisplayName(LocationNames.LocationType.REGION); } else if (country != null) { return getDisplayName((LocationNames.LocationType.COUNTRY)); } else if (bloc != null) { return getDisplayName(LocationNames.LocationType.BLOC); } return null; } }
PlaceName { @JsonIgnore public String getDefaultName() { if (district != null) { return getDisplayName(LocationNames.LocationType.DISTRICT); } else if (settlement != null) { return getDisplayName(LocationNames.LocationType.SETTLEMENT); } else if (region != null) { return getDisplayName(LocationNames.LocationType.REGION); } else if (country != null) { return getDisplayName((LocationNames.LocationType.COUNTRY)); } else if (bloc != null) { return getDisplayName(LocationNames.LocationType.BLOC); } return null; } PlaceName(); }
PlaceName { @JsonIgnore public String getDefaultName() { if (district != null) { return getDisplayName(LocationNames.LocationType.DISTRICT); } else if (settlement != null) { return getDisplayName(LocationNames.LocationType.SETTLEMENT); } else if (region != null) { return getDisplayName(LocationNames.LocationType.REGION); } else if (country != null) { return getDisplayName((LocationNames.LocationType.COUNTRY)); } else if (bloc != null) { return getDisplayName(LocationNames.LocationType.BLOC); } return null; } PlaceName(); @JsonIgnore String getDisplayName(LocationNames.LocationType type); @JsonIgnore String getMediumName(); String getDistrict(); PlaceName setDistrict(String district); String getSettlement(); PlaceName setSettlement(String settlement); String getRegion(); PlaceName setRegion(String region); String getCountry(); PlaceName setCountry(String country); String getCountryCode(); PlaceName setCountryCode(String countryCode); String getBloc(); PlaceName setBloc(String bloc); @Override boolean equals(Object obj); @Override int hashCode(); @JsonIgnore String getDefaultName(); }
PlaceName { @JsonIgnore public String getDefaultName() { if (district != null) { return getDisplayName(LocationNames.LocationType.DISTRICT); } else if (settlement != null) { return getDisplayName(LocationNames.LocationType.SETTLEMENT); } else if (region != null) { return getDisplayName(LocationNames.LocationType.REGION); } else if (country != null) { return getDisplayName((LocationNames.LocationType.COUNTRY)); } else if (bloc != null) { return getDisplayName(LocationNames.LocationType.BLOC); } return null; } PlaceName(); @JsonIgnore String getDisplayName(LocationNames.LocationType type); @JsonIgnore String getMediumName(); String getDistrict(); PlaceName setDistrict(String district); String getSettlement(); PlaceName setSettlement(String settlement); String getRegion(); PlaceName setRegion(String region); String getCountry(); PlaceName setCountry(String country); String getCountryCode(); PlaceName setCountryCode(String countryCode); String getBloc(); PlaceName setBloc(String bloc); @Override boolean equals(Object obj); @Override int hashCode(); @JsonIgnore String getDefaultName();  }