Skip to content

Commit e7aec13

Browse files
committed
3.3.0 release
1 parent 15d85a7 commit e7aec13

18 files changed

+486
-100
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Adheres to [Semantic Versioning](http://semver.org/).
44

55
---
66

7-
## 3.2.1 (TBD)
7+
## [3.3.0](https://github.com/ngageoint/simple-features-geojson-java/releases/tag/3.3.0) (10-03-2022)
88

9-
* TBD
9+
* GeoJsonObject hierarchy (Geometries and Features) equals and hashCode implementations
1010

1111
## [3.2.0](https://github.com/ngageoint/simple-features-geojson-java/releases/tag/3.2.0) (09-21-2022)
1212

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ Map<String, Object> contentMap = FeatureConverter.toMap(geometry);
5353

5454
### Installation ###
5555

56-
Pull from the [Maven Central Repository](http://search.maven.org/#artifactdetails|mil.nga.sf|sf-geojson|3.2.0|jar) (JAR, POM, Source, Javadoc)
56+
Pull from the [Maven Central Repository](http://search.maven.org/#artifactdetails|mil.nga.sf|sf-geojson|3.3.0|jar) (JAR, POM, Source, Javadoc)
5757

5858
```xml
5959

6060
<dependency>
6161
<groupId>mil.nga.sf</groupId>
6262
<artifactId>sf-geojson</artifactId>
63-
<version>3.2.0</version>
63+
<version>3.3.0</version>
6464
</dependency>
6565

6666
```

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h2 class="project-tagline">by the National Geospatial-Intelligence Agency</h2>
1717
<a href="http://ngageoint.github.io/simple-features-geojson-java/docs/api/" class="btn">API</a>
1818
<a href="https://github.com/ngageoint/simple-features-geojson-java/zipball/master" class="btn">.zip</a>
1919
<a href="https://github.com/ngageoint/simple-features-geojson-java/tarball/master" class="btn">.tar.gz</a>
20-
<a href="http://search.maven.org/#artifactdetails|mil.nga.sf|sf-geojson|3.2.0|jar" class="btn">The Central Repository</a>
20+
<a href="http://search.maven.org/#artifactdetails|mil.nga.sf|sf-geojson|3.3.0|jar" class="btn">The Central Repository</a>
2121
</section>
2222

2323
<section class="main-content">

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>mil.nga.sf</groupId>
55
<artifactId>sf-geojson</artifactId>
6-
<version>3.2.1</version>
6+
<version>3.3.0</version>
77
<packaging>jar</packaging>
88
<name>Simple Features GeoJSON</name>
99
<url>https://github.com/ngageoint/simple-features-geojson-java</url>

src/main/java/mil/nga/sf/geojson/Feature.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,49 @@ public String getType() {
140140
return "Feature";
141141
}
142142

143+
/**
144+
* {@inheritDoc}
145+
*/
146+
@Override
147+
public int hashCode() {
148+
final int prime = 31;
149+
int result = super.hashCode();
150+
result = prime * result
151+
+ ((geometry == null) ? 0 : geometry.hashCode());
152+
result = prime * result + ((id == null) ? 0 : id.hashCode());
153+
result = prime * result
154+
+ ((properties == null) ? 0 : properties.hashCode());
155+
return result;
156+
}
157+
158+
/**
159+
* {@inheritDoc}
160+
*/
161+
@Override
162+
public boolean equals(Object obj) {
163+
if (this == obj)
164+
return true;
165+
if (!super.equals(obj))
166+
return false;
167+
if (getClass() != obj.getClass())
168+
return false;
169+
Feature other = (Feature) obj;
170+
if (geometry == null) {
171+
if (other.geometry != null)
172+
return false;
173+
} else if (!geometry.equals(other.geometry))
174+
return false;
175+
if (id == null) {
176+
if (other.id != null)
177+
return false;
178+
} else if (!id.equals(other.id))
179+
return false;
180+
if (properties == null) {
181+
if (other.properties != null)
182+
return false;
183+
} else if (!properties.equals(other.properties))
184+
return false;
185+
return true;
186+
}
187+
143188
}

src/main/java/mil/nga/sf/geojson/FeatureCollection.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,36 @@ public String getType() {
173173
return "FeatureCollection";
174174
}
175175

176+
/**
177+
* {@inheritDoc}
178+
*/
179+
@Override
180+
public int hashCode() {
181+
final int prime = 31;
182+
int result = super.hashCode();
183+
result = prime * result
184+
+ ((features == null) ? 0 : features.hashCode());
185+
return result;
186+
}
187+
188+
/**
189+
* {@inheritDoc}
190+
*/
191+
@Override
192+
public boolean equals(Object obj) {
193+
if (this == obj)
194+
return true;
195+
if (!super.equals(obj))
196+
return false;
197+
if (getClass() != obj.getClass())
198+
return false;
199+
FeatureCollection other = (FeatureCollection) obj;
200+
if (features == null) {
201+
if (other.features != null)
202+
return false;
203+
} else if (!features.equals(other.features))
204+
return false;
205+
return true;
206+
}
207+
176208
}

src/main/java/mil/nga/sf/geojson/GeoJsonObject.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package mil.nga.sf.geojson;
22

33
import java.io.Serializable;
4+
import java.util.Arrays;
45
import java.util.HashMap;
56
import java.util.Map;
67

@@ -119,4 +120,39 @@ public boolean hasForeignMembers() {
119120
return !foreignMembers.isEmpty();
120121
}
121122

123+
/**
124+
* {@inheritDoc}
125+
*/
126+
@Override
127+
public int hashCode() {
128+
final int prime = 31;
129+
int result = 1;
130+
result = prime * result + Arrays.hashCode(bbox);
131+
result = prime * result
132+
+ ((foreignMembers == null) ? 0 : foreignMembers.hashCode());
133+
return result;
134+
}
135+
136+
/**
137+
* {@inheritDoc}
138+
*/
139+
@Override
140+
public boolean equals(Object obj) {
141+
if (this == obj)
142+
return true;
143+
if (obj == null)
144+
return false;
145+
if (getClass() != obj.getClass())
146+
return false;
147+
GeoJsonObject other = (GeoJsonObject) obj;
148+
if (!Arrays.equals(bbox, other.bbox))
149+
return false;
150+
if (foreignMembers == null) {
151+
if (other.foreignMembers != null)
152+
return false;
153+
} else if (!foreignMembers.equals(other.foreignMembers))
154+
return false;
155+
return true;
156+
}
157+
122158
}

src/main/java/mil/nga/sf/geojson/GeometryCollection.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,36 @@ public void setGeometryCollection(
117117
}
118118
}
119119

120+
/**
121+
* {@inheritDoc}
122+
*/
123+
@Override
124+
public int hashCode() {
125+
final int prime = 31;
126+
int result = super.hashCode();
127+
result = prime * result
128+
+ ((geometries == null) ? 0 : geometries.hashCode());
129+
return result;
130+
}
131+
132+
/**
133+
* {@inheritDoc}
134+
*/
135+
@Override
136+
public boolean equals(Object obj) {
137+
if (this == obj)
138+
return true;
139+
if (!super.equals(obj))
140+
return false;
141+
if (getClass() != obj.getClass())
142+
return false;
143+
GeometryCollection other = (GeometryCollection) obj;
144+
if (geometries == null) {
145+
if (other.geometries != null)
146+
return false;
147+
} else if (!geometries.equals(other.geometries))
148+
return false;
149+
return true;
150+
}
151+
120152
}

src/main/java/mil/nga/sf/geojson/LineString.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,35 @@ public void setLineString(mil.nga.sf.LineString lineString) {
135135
}
136136
}
137137

138+
/**
139+
* {@inheritDoc}
140+
*/
141+
@Override
142+
public int hashCode() {
143+
final int prime = 31;
144+
int result = super.hashCode();
145+
result = prime * result + ((points == null) ? 0 : points.hashCode());
146+
return result;
147+
}
148+
149+
/**
150+
* {@inheritDoc}
151+
*/
152+
@Override
153+
public boolean equals(Object obj) {
154+
if (this == obj)
155+
return true;
156+
if (!super.equals(obj))
157+
return false;
158+
if (getClass() != obj.getClass())
159+
return false;
160+
LineString other = (LineString) obj;
161+
if (points == null) {
162+
if (other.points != null)
163+
return false;
164+
} else if (!points.equals(other.points))
165+
return false;
166+
return true;
167+
}
168+
138169
}

src/main/java/mil/nga/sf/geojson/MultiLineString.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,36 @@ public void setMultiLineString(mil.nga.sf.MultiLineString multiLineString) {
160160
}
161161
}
162162

163+
/**
164+
* {@inheritDoc}
165+
*/
166+
@Override
167+
public int hashCode() {
168+
final int prime = 31;
169+
int result = super.hashCode();
170+
result = prime * result
171+
+ ((lineStrings == null) ? 0 : lineStrings.hashCode());
172+
return result;
173+
}
174+
175+
/**
176+
* {@inheritDoc}
177+
*/
178+
@Override
179+
public boolean equals(Object obj) {
180+
if (this == obj)
181+
return true;
182+
if (!super.equals(obj))
183+
return false;
184+
if (getClass() != obj.getClass())
185+
return false;
186+
MultiLineString other = (MultiLineString) obj;
187+
if (lineStrings == null) {
188+
if (other.lineStrings != null)
189+
return false;
190+
} else if (!lineStrings.equals(other.lineStrings))
191+
return false;
192+
return true;
193+
}
194+
163195
}

0 commit comments

Comments
 (0)