GeonamesGisFeature implements GisFeature, DistanceCalculator<GisFeature> { public static GisFeatureBuilder gisFeature() { return new GisFeatureBuilder(); } private  GeonamesGisFeature(); static GisFeatureBuilder gisFeature(); double distance(GisFeature o, Unit<Length> unit); @Override int hashCode(); @Override boolean equals(Object obj); GisFeatureGeography getGeography(); String getGeonamesFeatureClass(); String getGeonamesFeatureCode(); Long getGeonamesId(); GeonamesGisFeature getGisFeature(); ImmutableSet<AlternateGisFeatureName> getGisFeatureAlternateNames(); String getGisFeatureAsciiName(); String getGisFeatureDefaultName(); Long getElevation(); Long getGtopo30AverageElevation(); double getLatitude(); Point getLocation(); double getLongitude(); Long getPopulation(); String getGisFeaturePreferredName(Iso639Language language); String getGisFeatureShortName(Iso639Language language); DateTimeZone getTimeZone(); DateTime getLastModificationDate(); String getName(); GisFeatureNames getNames(); GisFeatureType getGisFeatureType(); AdministrativeEntity getParentAdministrativeEntity(); GisFeatureType getType(); @Override String toString(); ImmutableList<NamePart> getFullyQualifiedNameParts(); String getFriendlyCode(); GisFeatureId getGisFeatureId(); static final int WGS84_SRID; static final PrecisionModel PRECISION_MODEL; static final GeometryFactory GEOMETRY_FACTORY; }
@Test public void shouldCreateGisFeature() { GeonamesGisFeature.gisFeature() .geonamesId(1L) .names(GisFeatureNames.gisFeatureName("France")) .type(geonamesFeatureClass("A").geonamesFeatureCode("PLCI")) .geography(GisFeatureGeography.gisFeatureGeography(2.0, 46.0)) .build(); }
@Test public void shouldCreateGisFeatureWithModificationDate() { GeonamesGisFeature.gisFeature() .geonamesId(1L) .names(GisFeatureNames.gisFeatureName("France")) .type(geonamesFeatureClass("A").geonamesFeatureCode("PLCI")) .geography(GisFeatureGeography.gisFeatureGeography(2.0, 46.0)) .lastModificationDate(new DateTime()) .build(); }
@Test public void shouldCreateGisFeatureWithNullParentEntity() { GeonamesGisFeature.gisFeature() .geonamesId(1L) .names(GisFeatureNames.gisFeatureName("France")) .type(geonamesFeatureClass("A").geonamesFeatureCode("PLCI")) .geography(GisFeatureGeography.gisFeatureGeography(2.0, 46.0)) .lastModificationDate(new DateTime()) .parentAdministrativeEntity(null) .build(); }
@Test(expected=IllegalArgumentException.class) public void shouldNotCreateGisFeatureWithNullFeatureId() { GeonamesGisFeature.gisFeature() .geonamesId(null) .names(GisFeatureNames.gisFeatureName("France")) .type(geonamesFeatureClass("A").geonamesFeatureCode("PLCI")) .geography(GisFeatureGeography.gisFeatureGeography(2.0, 46.0)) .build(); }
@Test(expected=IllegalArgumentException.class) public void shouldNotCreateGisFeatureWithNullFeatureType() { GeonamesGisFeature.gisFeature() .geonamesId(1L) .names(GisFeatureNames.gisFeatureName("France")) .type(null) .geography(GisFeatureGeography.gisFeatureGeography(2.0, 46.0)) .build(); }
@Test(expected=IllegalArgumentException.class) public void shouldNotCreateGisFeatureWithNullGeography() { GeonamesGisFeature.gisFeature() .geonamesId(1L) .names(GisFeatureNames.gisFeatureName("France")) .type(geonamesFeatureClass("A").geonamesFeatureCode("PLCI")) .build(); }