This is an automated email from the ASF dual-hosted git repository.
jsorel pushed a commit to branch feat/style
in repository https://gitbox.apache.org/repos/asf/sis.git
The following commit(s) were added to refs/heads/feat/style by this push:
new 895a4df17f Style : update hashcode and equals formating
895a4df17f is described below
commit 895a4df17f8f33cd85f85f3fe1d26dbf6a4c1b33
Author: jsorel <[email protected]>
AuthorDate: Wed May 18 10:11:45 2022 +0200
Style : update hashcode and equals formating
---
.../org/apache/sis/internal/style/AnchorPoint.java | 11 ++----
.../sis/internal/style/ChannelSelection.java | 21 +++-------
.../org/apache/sis/internal/style/ColorMap.java | 4 +-
.../sis/internal/style/ColorReplacement.java | 4 +-
.../sis/internal/style/ContrastEnhancement.java | 11 ++----
.../org/apache/sis/internal/style/Description.java | 11 ++----
.../apache/sis/internal/style/Displacement.java | 11 ++----
.../apache/sis/internal/style/ExternalGraphic.java | 21 +++-------
.../apache/sis/internal/style/ExternalMark.java | 21 +++-------
.../sis/internal/style/FeatureTypeStyle.java | 36 ++++-------------
.../java/org/apache/sis/internal/style/Fill.java | 16 ++------
.../java/org/apache/sis/internal/style/Font.java | 21 +++-------
.../org/apache/sis/internal/style/Graphic.java | 31 ++++-----------
.../org/apache/sis/internal/style/GraphicFill.java | 6 +++
.../apache/sis/internal/style/GraphicLegend.java | 6 +++
.../apache/sis/internal/style/GraphicStroke.java | 19 +++++++++
.../apache/sis/internal/style/GraphicalSymbol.java | 2 +-
.../java/org/apache/sis/internal/style/Halo.java | 11 ++----
.../apache/sis/internal/style/LinePlacement.java | 31 ++++-----------
.../apache/sis/internal/style/LineSymbolizer.java | 11 ++----
.../java/org/apache/sis/internal/style/Mark.java | 21 +++-------
.../apache/sis/internal/style/PointPlacement.java | 16 ++------
.../apache/sis/internal/style/PointSymbolizer.java | 4 +-
.../sis/internal/style/PolygonSymbolizer.java | 21 +++-------
.../sis/internal/style/RasterSymbolizer.java | 37 +++++------------
.../java/org/apache/sis/internal/style/Rule.java | 46 +++++-----------------
.../sis/internal/style/SelectedChannelType.java | 11 ++----
.../apache/sis/internal/style/ShadedRelief.java | 11 ++----
.../java/org/apache/sis/internal/style/Stroke.java | 46 +++++-----------------
.../java/org/apache/sis/internal/style/Style.java | 16 ++------
.../org/apache/sis/internal/style/Symbolizer.java | 21 +++-------
.../apache/sis/internal/style/TextSymbolizer.java | 22 +++++++++++
32 files changed, 179 insertions(+), 398 deletions(-)
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/AnchorPoint.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/AnchorPoint.java
index 7b4451791c..21231d5ed9 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/AnchorPoint.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/AnchorPoint.java
@@ -57,10 +57,7 @@ public final class AnchorPoint implements
org.opengis.style.AnchorPoint {
@Override
public int hashCode() {
- int hash = 7;
- hash = 53 * hash + Objects.hashCode(this.x);
- hash = 53 * hash + Objects.hashCode(this.y);
- return hash;
+ return Objects.hash(x, y);
}
@Override
@@ -75,10 +72,8 @@ public final class AnchorPoint implements
org.opengis.style.AnchorPoint {
return false;
}
final AnchorPoint other = (AnchorPoint) obj;
- if (!Objects.equals(this.x, other.x)) {
- return false;
- }
- return Objects.equals(this.y, other.y);
+ return Objects.equals(this.x, other.x)
+ && Objects.equals(this.y, other.y);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ChannelSelection.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ChannelSelection.java
index 410bcf0798..1dd38c4cbe 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ChannelSelection.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ChannelSelection.java
@@ -75,12 +75,7 @@ public final class ChannelSelection implements
org.opengis.style.ChannelSelectio
@Override
public int hashCode() {
- int hash = 7;
- hash = 79 * hash + Objects.hashCode(this.gray);
- hash = 79 * hash + Objects.hashCode(this.red);
- hash = 79 * hash + Objects.hashCode(this.green);
- hash = 79 * hash + Objects.hashCode(this.blue);
- return hash;
+ return Objects.hash(gray, red, green, blue);
}
@Override
@@ -95,16 +90,10 @@ public final class ChannelSelection implements
org.opengis.style.ChannelSelectio
return false;
}
final ChannelSelection other = (ChannelSelection) obj;
- if (!Objects.equals(this.gray, other.gray)) {
- return false;
- }
- if (!Objects.equals(this.red, other.red)) {
- return false;
- }
- if (!Objects.equals(this.green, other.green)) {
- return false;
- }
- return Objects.equals(this.blue, other.blue);
+ return Objects.equals(this.gray, other.gray)
+ && Objects.equals(this.red, other.red)
+ && Objects.equals(this.green, other.green)
+ && Objects.equals(this.blue, other.blue);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ColorMap.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ColorMap.java
index 04174c14df..dbff38ef06 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ColorMap.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ColorMap.java
@@ -40,9 +40,7 @@ public final class ColorMap implements
org.opengis.style.ColorMap {
@Override
public int hashCode() {
- int hash = 7;
- hash = 97 * hash + Objects.hashCode(this.function);
- return hash;
+ return Objects.hash(function);
}
@Override
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ColorReplacement.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ColorReplacement.java
index fa82eb9ee5..dd3eb206be 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ColorReplacement.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ColorReplacement.java
@@ -40,9 +40,7 @@ public final class ColorReplacement implements
org.opengis.style.ColorReplacemen
@Override
public int hashCode() {
- int hash = 3;
- hash = 11 * hash + Objects.hashCode(this.recoding);
- return hash;
+ return Objects.hash(recoding);
}
@Override
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ContrastEnhancement.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ContrastEnhancement.java
index 40ad18db37..b1821458a7 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ContrastEnhancement.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ContrastEnhancement.java
@@ -58,10 +58,7 @@ public final class ContrastEnhancement implements
org.opengis.style.ContrastEnha
@Override
public int hashCode() {
- int hash = 7;
- hash = 37 * hash + Objects.hashCode(this.method);
- hash = 37 * hash + Objects.hashCode(this.gammaValue);
- return hash;
+ return Objects.hash(method, gammaValue);
}
@Override
@@ -76,10 +73,8 @@ public final class ContrastEnhancement implements
org.opengis.style.ContrastEnha
return false;
}
final ContrastEnhancement other = (ContrastEnhancement) obj;
- if (!Objects.equals(this.method, other.method)) {
- return false;
- }
- return Objects.equals(this.gammaValue, other.gammaValue);
+ return Objects.equals(this.method, other.method)
+ && Objects.equals(this.gammaValue, other.gammaValue);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Description.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Description.java
index 333af9d2ff..87bd930bf6 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Description.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Description.java
@@ -56,10 +56,7 @@ public final class Description implements
org.opengis.style.Description {
@Override
public int hashCode() {
- int hash = 3;
- hash = 89 * hash + Objects.hashCode(this.title);
- hash = 89 * hash + Objects.hashCode(this.abstrat);
- return hash;
+ return Objects.hash(title, abstrat);
}
@Override
@@ -74,10 +71,8 @@ public final class Description implements
org.opengis.style.Description {
return false;
}
final Description other = (Description) obj;
- if (!Objects.equals(this.title, other.title)) {
- return false;
- }
- return Objects.equals(this.abstrat, other.abstrat);
+ return Objects.equals(this.title, other.title)
+ && Objects.equals(this.abstrat, other.abstrat);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Displacement.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Displacement.java
index c2fc2554a6..85e7073936 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Displacement.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Displacement.java
@@ -57,10 +57,7 @@ public final class Displacement implements
org.opengis.style.Displacement {
@Override
public int hashCode() {
- int hash = 5;
- hash = 79 * hash + Objects.hashCode(this.displacementX);
- hash = 79 * hash + Objects.hashCode(this.displacementY);
- return hash;
+ return Objects.hash(displacementX, displacementY);
}
@Override
@@ -75,10 +72,8 @@ public final class Displacement implements
org.opengis.style.Displacement {
return false;
}
final Displacement other = (Displacement) obj;
- if (!Objects.equals(this.displacementX, other.displacementX)) {
- return false;
- }
- return Objects.equals(this.displacementY, other.displacementY);
+ return Objects.equals(this.displacementX, other.displacementX)
+ && Objects.equals(this.displacementY, other.displacementY);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ExternalGraphic.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ExternalGraphic.java
index 1bc1127097..8c8de715e3 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ExternalGraphic.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ExternalGraphic.java
@@ -76,12 +76,7 @@ public final class ExternalGraphic implements
org.opengis.style.ExternalGraphic,
@Override
public int hashCode() {
- int hash = 5;
- hash = 11 * hash + Objects.hashCode(this.onlineResource);
- hash = 11 * hash + Objects.hashCode(this.inlineContent);
- hash = 11 * hash + Objects.hashCode(this.format);
- hash = 11 * hash + Objects.hashCode(this.colorReplacements);
- return hash;
+ return Objects.hash(onlineResource, inlineContent, format,
colorReplacements);
}
@Override
@@ -96,16 +91,10 @@ public final class ExternalGraphic implements
org.opengis.style.ExternalGraphic,
return false;
}
final ExternalGraphic other = (ExternalGraphic) obj;
- if (!Objects.equals(this.format, other.format)) {
- return false;
- }
- if (!Objects.equals(this.onlineResource, other.onlineResource)) {
- return false;
- }
- if (!Objects.equals(this.inlineContent, other.inlineContent)) {
- return false;
- }
- return Objects.equals(this.colorReplacements, other.colorReplacements);
+ return Objects.equals(this.format, other.format)
+ && Objects.equals(this.onlineResource, other.onlineResource)
+ && Objects.equals(this.inlineContent, other.inlineContent)
+ && Objects.equals(this.colorReplacements, other.colorReplacements);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ExternalMark.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ExternalMark.java
index a64ecb50c9..c11ad9ffcd 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ExternalMark.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ExternalMark.java
@@ -73,12 +73,7 @@ public final class ExternalMark implements
org.opengis.style.ExternalMark {
@Override
public int hashCode() {
- int hash = 7;
- hash = 59 * hash + Objects.hashCode(this.onlineResource);
- hash = 59 * hash + Objects.hashCode(this.inlineContent);
- hash = 59 * hash + Objects.hashCode(this.format);
- hash = 59 * hash + this.markIndex;
- return hash;
+ return Objects.hash(onlineResource, inlineContent, format, markIndex);
}
@Override
@@ -93,16 +88,10 @@ public final class ExternalMark implements
org.opengis.style.ExternalMark {
return false;
}
final ExternalMark other = (ExternalMark) obj;
- if (this.markIndex != other.markIndex) {
- return false;
- }
- if (!Objects.equals(this.format, other.format)) {
- return false;
- }
- if (!Objects.equals(this.onlineResource, other.onlineResource)) {
- return false;
- }
- return Objects.equals(this.inlineContent, other.inlineContent);
+ return this.markIndex == other.markIndex
+ && Objects.equals(this.format, other.format)
+ && Objects.equals(this.onlineResource, other.onlineResource)
+ && Objects.equals(this.inlineContent, other.inlineContent);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/FeatureTypeStyle.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/FeatureTypeStyle.java
index 9e80425b8e..3e0947ceec 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/FeatureTypeStyle.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/FeatureTypeStyle.java
@@ -100,15 +100,7 @@ public final class FeatureTypeStyle implements
org.opengis.style.FeatureTypeStyl
@Override
public int hashCode() {
- int hash = 7;
- hash = 53 * hash + Objects.hashCode(this.name);
- hash = 53 * hash + Objects.hashCode(this.description);
- hash = 53 * hash + Objects.hashCode(this.featureInstanceIDs);
- hash = 53 * hash + Objects.hashCode(this.featureTypeNames);
- hash = 53 * hash + Objects.hashCode(this.semanticTypeIdentifiers);
- hash = 53 * hash + Objects.hashCode(this.rules);
- hash = 53 * hash + Objects.hashCode(this.onlineResource);
- return hash;
+ return Objects.hash(name, description, featureInstanceIDs,
featureTypeNames, semanticTypeIdentifiers, rules, onlineResource);
}
@Override
@@ -123,25 +115,13 @@ public final class FeatureTypeStyle implements
org.opengis.style.FeatureTypeStyl
return false;
}
final FeatureTypeStyle other = (FeatureTypeStyle) obj;
- if (!Objects.equals(this.name, other.name)) {
- return false;
- }
- if (!Objects.equals(this.description, other.description)) {
- return false;
- }
- if (!Objects.equals(this.featureInstanceIDs,
other.featureInstanceIDs)) {
- return false;
- }
- if (!Objects.equals(this.featureTypeNames, other.featureTypeNames)) {
- return false;
- }
- if (!Objects.equals(this.semanticTypeIdentifiers,
other.semanticTypeIdentifiers)) {
- return false;
- }
- if (!Objects.equals(this.rules, other.rules)) {
- return false;
- }
- return Objects.equals(this.onlineResource, other.onlineResource);
+ return Objects.equals(this.name, other.name)
+ && Objects.equals(this.description, other.description)
+ && Objects.equals(this.featureInstanceIDs,
other.featureInstanceIDs)
+ && Objects.equals(this.featureTypeNames, other.featureTypeNames)
+ && Objects.equals(this.semanticTypeIdentifiers,
other.semanticTypeIdentifiers)
+ && Objects.equals(this.rules, other.rules)
+ && Objects.equals(this.onlineResource, other.onlineResource);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Fill.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Fill.java
index 1dd56a6fa5..f04b2d3125 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Fill.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Fill.java
@@ -69,11 +69,7 @@ public final class Fill implements org.opengis.style.Fill {
@Override
public int hashCode() {
- int hash = 7;
- hash = 23 * hash + Objects.hashCode(this.graphicFill);
- hash = 23 * hash + Objects.hashCode(this.color);
- hash = 23 * hash + Objects.hashCode(this.opacity);
- return hash;
+ return Objects.hash(graphicFill, color, opacity);
}
@Override
@@ -88,13 +84,9 @@ public final class Fill implements org.opengis.style.Fill {
return false;
}
final Fill other = (Fill) obj;
- if (!Objects.equals(this.graphicFill, other.graphicFill)) {
- return false;
- }
- if (!Objects.equals(this.color, other.color)) {
- return false;
- }
- return Objects.equals(this.opacity, other.opacity);
+ return Objects.equals(this.graphicFill, other.graphicFill)
+ && Objects.equals(this.color, other.color)
+ && Objects.equals(this.opacity, other.opacity);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Font.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Font.java
index 696eb5507d..65af5a4071 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Font.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Font.java
@@ -76,12 +76,7 @@ public final class Font implements org.opengis.style.Font {
@Override
public int hashCode() {
- int hash = 5;
- hash = 79 * hash + Objects.hashCode(this.family);
- hash = 79 * hash + Objects.hashCode(this.style);
- hash = 79 * hash + Objects.hashCode(this.weight);
- hash = 79 * hash + Objects.hashCode(this.size);
- return hash;
+ return Objects.hash(family, style, weight, size);
}
@Override
@@ -96,16 +91,10 @@ public final class Font implements org.opengis.style.Font {
return false;
}
final Font other = (Font) obj;
- if (!Objects.equals(this.family, other.family)) {
- return false;
- }
- if (!Objects.equals(this.style, other.style)) {
- return false;
- }
- if (!Objects.equals(this.weight, other.weight)) {
- return false;
- }
- return Objects.equals(this.size, other.size);
+ return Objects.equals(this.family, other.family)
+ && Objects.equals(this.style, other.style)
+ && Objects.equals(this.weight, other.weight)
+ && Objects.equals(this.size, other.size);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Graphic.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Graphic.java
index 53dd85d76a..504fb2d234 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Graphic.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Graphic.java
@@ -110,14 +110,7 @@ public class Graphic implements org.opengis.style.Graphic {
@Override
public int hashCode() {
- int hash = 7;
- hash = 17 * hash + Objects.hashCode(this.graphicalSymbols);
- hash = 17 * hash + Objects.hashCode(this.opacity);
- hash = 17 * hash + Objects.hashCode(this.size);
- hash = 17 * hash + Objects.hashCode(this.rotation);
- hash = 17 * hash + Objects.hashCode(this.anchorPoint);
- hash = 17 * hash + Objects.hashCode(this.displacement);
- return hash;
+ return Objects.hash(graphicalSymbols, opacity, size, rotation,
anchorPoint, displacement);
}
@Override
@@ -132,22 +125,12 @@ public class Graphic implements org.opengis.style.Graphic
{
return false;
}
final Graphic other = (Graphic) obj;
- if (!Objects.equals(this.graphicalSymbols, other.graphicalSymbols)) {
- return false;
- }
- if (!Objects.equals(this.opacity, other.opacity)) {
- return false;
- }
- if (!Objects.equals(this.size, other.size)) {
- return false;
- }
- if (!Objects.equals(this.rotation, other.rotation)) {
- return false;
- }
- if (!Objects.equals(this.anchorPoint, other.anchorPoint)) {
- return false;
- }
- return Objects.equals(this.displacement, other.displacement);
+ return Objects.equals(this.graphicalSymbols, other.graphicalSymbols)
+ && Objects.equals(this.opacity, other.opacity)
+ && Objects.equals(this.size, other.size)
+ && Objects.equals(this.rotation, other.rotation)
+ && Objects.equals(this.anchorPoint, other.anchorPoint)
+ && Objects.equals(this.displacement, other.displacement);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicFill.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicFill.java
index a54789ec31..d46d4c8f46 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicFill.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicFill.java
@@ -33,6 +33,12 @@ public final class GraphicFill extends Graphic implements
org.opengis.style.Grap
return visitor.visit(this, extraData);
}
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj)
+ && obj instanceof GraphicFill;
+ }
+
/**
* Cast or copy to an SIS implementation.
*
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicLegend.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicLegend.java
index 1e9f79573e..1c158c8b02 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicLegend.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicLegend.java
@@ -33,6 +33,12 @@ public final class GraphicLegend extends Graphic implements
org.opengis.style.Gr
return visitor.visit(this, extraData);
}
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj)
+ && obj instanceof GraphicLegend;
+ }
+
/**
* Cast or copy to an SIS implementation.
*
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicStroke.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicStroke.java
index 56b4e705f8..b581e5de4f 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicStroke.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicStroke.java
@@ -5,6 +5,7 @@ package org.apache.sis.internal.style;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import org.opengis.feature.Feature;
import org.opengis.filter.Expression;
import org.opengis.style.StyleVisitor;
@@ -58,6 +59,24 @@ public final class GraphicStroke extends Graphic implements
org.opengis.style.Gr
return visitor.visit(this, extraData);
}
+ @Override
+ public int hashCode() {
+ return super.hashCode() + Objects.hash(initialGap, gap);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof GraphicStroke)) {
+ return false;
+ }
+ final GraphicStroke other = (GraphicStroke) obj;
+ return Objects.equals(this.initialGap, other.initialGap)
+ && Objects.equals(this.gap, other.gap);
+ }
+
/**
* Cast or copy to an SIS implementation.
*
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicalSymbol.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicalSymbol.java
index 0805ba742b..5e5aa1ab61 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicalSymbol.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/GraphicalSymbol.java
@@ -7,7 +7,7 @@ package org.apache.sis.internal.style;
*
* @author Johann Sorel (Geomatys)
*/
-public interface GraphicalSymbol extends org.opengis.style.GraphicalSymbol {
+public interface GraphicalSymbol extends org.opengis.style.GraphicalSymbol {
public static GraphicalSymbol castOrCopy(org.opengis.style.GraphicalSymbol
candidate) {
if (candidate == null) {
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Halo.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Halo.java
index 7db279d255..e3acf7e0e9 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Halo.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Halo.java
@@ -58,10 +58,7 @@ public final class Halo implements org.opengis.style.Halo {
@Override
public int hashCode() {
- int hash = 3;
- hash = 37 * hash + Objects.hashCode(this.fill);
- hash = 37 * hash + Objects.hashCode(this.radius);
- return hash;
+ return Objects.hash(fill, radius);
}
@Override
@@ -76,10 +73,8 @@ public final class Halo implements org.opengis.style.Halo {
return false;
}
final Halo other = (Halo) obj;
- if (!Objects.equals(this.fill, other.fill)) {
- return false;
- }
- return Objects.equals(this.radius, other.radius);
+ return Objects.equals(this.fill, other.fill)
+ && Objects.equals(this.radius, other.radius);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/LinePlacement.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/LinePlacement.java
index 27d8f6c327..8ce8fb2287 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/LinePlacement.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/LinePlacement.java
@@ -99,14 +99,7 @@ public final class LinePlacement implements LabelPlacement,
org.opengis.style.Li
@Override
public int hashCode() {
- int hash = 7;
- hash = 97 * hash + Objects.hashCode(this.perpendicularOffset);
- hash = 97 * hash + Objects.hashCode(this.initialGap);
- hash = 97 * hash + Objects.hashCode(this.gap);
- hash = 97 * hash + (this.repeated ? 1 : 0);
- hash = 97 * hash + (this.aligned ? 1 : 0);
- hash = 97 * hash + (this.generalizeLine ? 1 : 0);
- return hash;
+ return Objects.hash(perpendicularOffset, initialGap, gap, repeated,
aligned, generalizeLine);
}
@Override
@@ -121,22 +114,12 @@ public final class LinePlacement implements
LabelPlacement, org.opengis.style.Li
return false;
}
final LinePlacement other = (LinePlacement) obj;
- if (this.repeated != other.repeated) {
- return false;
- }
- if (this.aligned != other.aligned) {
- return false;
- }
- if (this.generalizeLine != other.generalizeLine) {
- return false;
- }
- if (!Objects.equals(this.perpendicularOffset,
other.perpendicularOffset)) {
- return false;
- }
- if (!Objects.equals(this.initialGap, other.initialGap)) {
- return false;
- }
- return Objects.equals(this.gap, other.gap);
+ return this.repeated == other.repeated
+ && this.aligned == other.aligned
+ && this.generalizeLine == other.generalizeLine
+ && Objects.equals(this.perpendicularOffset,
other.perpendicularOffset)
+ && Objects.equals(this.initialGap, other.initialGap)
+ && Objects.equals(this.gap, other.gap);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/LineSymbolizer.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/LineSymbolizer.java
index 26f9a8eba1..8e8e8f3593 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/LineSymbolizer.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/LineSymbolizer.java
@@ -61,10 +61,7 @@ public final class LineSymbolizer extends Symbolizer
implements org.opengis.styl
@Override
public int hashCode() {
- int hash = super.hashCode();
- hash = 89 * hash + Objects.hashCode(this.perpendicularOffset);
- hash = 89 * hash + Objects.hashCode(this.stroke);
- return hash;
+ return super.hashCode() + Objects.hash(perpendicularOffset, stroke);
}
@Override
@@ -82,10 +79,8 @@ public final class LineSymbolizer extends Symbolizer
implements org.opengis.styl
return false;
}
final LineSymbolizer other = (LineSymbolizer) obj;
- if (!Objects.equals(this.perpendicularOffset,
other.perpendicularOffset)) {
- return false;
- }
- return Objects.equals(this.stroke, other.stroke);
+ return Objects.equals(this.perpendicularOffset,
other.perpendicularOffset)
+ && Objects.equals(this.stroke, other.stroke);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Mark.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Mark.java
index 730799b5dc..f8f188980d 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Mark.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Mark.java
@@ -77,12 +77,7 @@ public final class Mark implements org.opengis.style.Mark,
GraphicalSymbol {
@Override
public int hashCode() {
- int hash = 5;
- hash = 71 * hash + Objects.hashCode(this.wellKnownName);
- hash = 71 * hash + Objects.hashCode(this.externalMark);
- hash = 71 * hash + Objects.hashCode(this.fill);
- hash = 71 * hash + Objects.hashCode(this.stroke);
- return hash;
+ return Objects.hash(wellKnownName, externalMark, fill, stroke);
}
@Override
@@ -97,16 +92,10 @@ public final class Mark implements org.opengis.style.Mark,
GraphicalSymbol {
return false;
}
final Mark other = (Mark) obj;
- if (!Objects.equals(this.wellKnownName, other.wellKnownName)) {
- return false;
- }
- if (!Objects.equals(this.externalMark, other.externalMark)) {
- return false;
- }
- if (!Objects.equals(this.fill, other.fill)) {
- return false;
- }
- return Objects.equals(this.stroke, other.stroke);
+ return Objects.equals(this.wellKnownName, other.wellKnownName)
+ && Objects.equals(this.externalMark, other.externalMark)
+ && Objects.equals(this.fill, other.fill)
+ && Objects.equals(this.stroke, other.stroke);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PointPlacement.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PointPlacement.java
index ad8e3bfa5e..26139ca4aa 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PointPlacement.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PointPlacement.java
@@ -65,11 +65,7 @@ public final class PointPlacement implements LabelPlacement,
org.opengis.style.P
@Override
public int hashCode() {
- int hash = 7;
- hash = 67 * hash + Objects.hashCode(this.anchorPoint);
- hash = 67 * hash + Objects.hashCode(this.displacement);
- hash = 67 * hash + Objects.hashCode(this.rotation);
- return hash;
+ return Objects.hash(anchorPoint, displacement, rotation);
}
@Override
@@ -84,13 +80,9 @@ public final class PointPlacement implements LabelPlacement,
org.opengis.style.P
return false;
}
final PointPlacement other = (PointPlacement) obj;
- if (!Objects.equals(this.anchorPoint, other.anchorPoint)) {
- return false;
- }
- if (!Objects.equals(this.displacement, other.displacement)) {
- return false;
- }
- return Objects.equals(this.rotation, other.rotation);
+ return Objects.equals(this.anchorPoint, other.anchorPoint)
+ && Objects.equals(this.displacement, other.displacement)
+ && Objects.equals(this.rotation, other.rotation);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PointSymbolizer.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PointSymbolizer.java
index 91703c9629..dc1e889b1f 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PointSymbolizer.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PointSymbolizer.java
@@ -51,9 +51,7 @@ public final class PointSymbolizer extends Symbolizer
implements org.opengis.sty
@Override
public int hashCode() {
- int hash = super.hashCode();
- hash = 71 * hash + Objects.hashCode(this.graphic);
- return hash;
+ return super.hashCode() + Objects.hashCode(this.graphic);
}
@Override
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PolygonSymbolizer.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PolygonSymbolizer.java
index e31b460594..6c6c690414 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PolygonSymbolizer.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/PolygonSymbolizer.java
@@ -82,12 +82,7 @@ public final class PolygonSymbolizer extends Symbolizer
implements org.opengis.s
@Override
public int hashCode() {
- int hash = super.hashCode();
- hash = 79 * hash + Objects.hashCode(this.stroke);
- hash = 79 * hash + Objects.hashCode(this.fill);
- hash = 79 * hash + Objects.hashCode(this.displacement);
- hash = 79 * hash + Objects.hashCode(this.offset);
- return hash;
+ return super.hashCode() + Objects.hash(stroke, fill, displacement,
offset);
}
@Override
@@ -105,16 +100,10 @@ public final class PolygonSymbolizer extends Symbolizer
implements org.opengis.s
return false;
}
final PolygonSymbolizer other = (PolygonSymbolizer) obj;
- if (!Objects.equals(this.stroke, other.stroke)) {
- return false;
- }
- if (!Objects.equals(this.fill, other.fill)) {
- return false;
- }
- if (!Objects.equals(this.displacement, other.displacement)) {
- return false;
- }
- return Objects.equals(this.offset, other.offset);
+ return Objects.equals(this.stroke, other.stroke)
+ && Objects.equals(this.fill, other.fill)
+ && Objects.equals(this.displacement, other.displacement)
+ && Objects.equals(this.offset, other.offset);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/RasterSymbolizer.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/RasterSymbolizer.java
index 0fc5a8a526..6e62c0832b 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/RasterSymbolizer.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/RasterSymbolizer.java
@@ -116,15 +116,8 @@ public final class RasterSymbolizer extends Symbolizer
implements org.opengis.st
@Override
public int hashCode() {
- int hash = super.hashCode();
- hash = 71 * hash + Objects.hashCode(this.opacity);
- hash = 71 * hash + Objects.hashCode(this.channelSelection);
- hash = 71 * hash + Objects.hashCode(this.overlapBehavior);
- hash = 71 * hash + Objects.hashCode(this.colorMap);
- hash = 71 * hash + Objects.hashCode(this.contrastEnhancement);
- hash = 71 * hash + Objects.hashCode(this.shadedRelief);
- hash = 71 * hash + Objects.hashCode(this.imageOutline);
- return hash;
+ return super.hashCode() + Objects.hash(opacity, channelSelection,
overlapBehavior,
+ colorMap, contrastEnhancement, shadedRelief, imageOutline);
}
@Override
@@ -142,25 +135,13 @@ public final class RasterSymbolizer extends Symbolizer
implements org.opengis.st
return false;
}
final RasterSymbolizer other = (RasterSymbolizer) obj;
- if (!Objects.equals(this.opacity, other.opacity)) {
- return false;
- }
- if (!Objects.equals(this.channelSelection, other.channelSelection)) {
- return false;
- }
- if (this.overlapBehavior != other.overlapBehavior) {
- return false;
- }
- if (!Objects.equals(this.colorMap, other.colorMap)) {
- return false;
- }
- if (!Objects.equals(this.contrastEnhancement,
other.contrastEnhancement)) {
- return false;
- }
- if (!Objects.equals(this.shadedRelief, other.shadedRelief)) {
- return false;
- }
- return Objects.equals(this.imageOutline, other.imageOutline);
+ return Objects.equals(this.opacity, other.opacity)
+ && Objects.equals(this.channelSelection, other.channelSelection)
+ && this.overlapBehavior == other.overlapBehavior
+ && Objects.equals(this.colorMap, other.colorMap)
+ && Objects.equals(this.contrastEnhancement,
other.contrastEnhancement)
+ && Objects.equals(this.shadedRelief, other.shadedRelief)
+ && Objects.equals(this.imageOutline, other.imageOutline);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Rule.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Rule.java
index 5adb200dce..821c8b6f8f 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Rule.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Rule.java
@@ -127,17 +127,7 @@ public final class Rule implements org.opengis.style.Rule {
@Override
public int hashCode() {
- int hash = 7;
- hash = 97 * hash + Objects.hashCode(this.name);
- hash = 97 * hash + Objects.hashCode(this.description);
- hash = 97 * hash + Objects.hashCode(this.legend);
- hash = 97 * hash + Objects.hashCode(this.filter);
- hash = 97 * hash + (this.elseFilter ? 1 : 0);
- hash = 97 * hash + (int) (Double.doubleToLongBits(this.minScale) ^
(Double.doubleToLongBits(this.minScale) >>> 32));
- hash = 97 * hash + (int) (Double.doubleToLongBits(this.maxScale) ^
(Double.doubleToLongBits(this.maxScale) >>> 32));
- hash = 97 * hash + Objects.hashCode(this.symbolizers);
- hash = 97 * hash + Objects.hashCode(this.onlineResource);
- return hash;
+ return Objects.hash(name, description, legend, filter, elseFilter,
minScale, maxScale, symbolizers, onlineResource);
}
@Override
@@ -152,31 +142,15 @@ public final class Rule implements org.opengis.style.Rule
{
return false;
}
final Rule other = (Rule) obj;
- if (this.elseFilter != other.elseFilter) {
- return false;
- }
- if (Double.doubleToLongBits(this.minScale) !=
Double.doubleToLongBits(other.minScale)) {
- return false;
- }
- if (Double.doubleToLongBits(this.maxScale) !=
Double.doubleToLongBits(other.maxScale)) {
- return false;
- }
- if (!Objects.equals(this.name, other.name)) {
- return false;
- }
- if (!Objects.equals(this.description, other.description)) {
- return false;
- }
- if (!Objects.equals(this.legend, other.legend)) {
- return false;
- }
- if (!Objects.equals(this.filter, other.filter)) {
- return false;
- }
- if (!Objects.equals(this.symbolizers, other.symbolizers)) {
- return false;
- }
- return Objects.equals(this.onlineResource, other.onlineResource);
+ return this.elseFilter == other.elseFilter
+ && this.minScale == other.minScale
+ && this.maxScale == other.maxScale
+ && Objects.equals(this.name, other.name)
+ && Objects.equals(this.description, other.description)
+ && Objects.equals(this.legend, other.legend)
+ && Objects.equals(this.filter, other.filter)
+ && Objects.equals(this.symbolizers, other.symbolizers)
+ && Objects.equals(this.onlineResource, other.onlineResource);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/SelectedChannelType.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/SelectedChannelType.java
index bd4044e225..7179cd8678 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/SelectedChannelType.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/SelectedChannelType.java
@@ -49,10 +49,7 @@ public final class SelectedChannelType implements
org.opengis.style.SelectedChan
@Override
public int hashCode() {
- int hash = 3;
- hash = 97 * hash + Objects.hashCode(this.channelName);
- hash = 97 * hash + Objects.hashCode(this.contrastEnhancement);
- return hash;
+ return Objects.hash(channelName, contrastEnhancement);
}
@Override
@@ -67,10 +64,8 @@ public final class SelectedChannelType implements
org.opengis.style.SelectedChan
return false;
}
final SelectedChannelType other = (SelectedChannelType) obj;
- if (!Objects.equals(this.channelName, other.channelName)) {
- return false;
- }
- return Objects.equals(this.contrastEnhancement,
other.contrastEnhancement);
+ return Objects.equals(this.channelName, other.channelName)
+ && Objects.equals(this.contrastEnhancement,
other.contrastEnhancement);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ShadedRelief.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ShadedRelief.java
index 8514b5c330..f4d2b95211 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ShadedRelief.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/ShadedRelief.java
@@ -51,10 +51,7 @@ public final class ShadedRelief implements
org.opengis.style.ShadedRelief {
@Override
public int hashCode() {
- int hash = 7;
- hash = 41 * hash + (this.brightnessOnly ? 1 : 0);
- hash = 41 * hash + Objects.hashCode(this.reliefFactor);
- return hash;
+ return Objects.hash(brightnessOnly, reliefFactor);
}
@Override
@@ -69,10 +66,8 @@ public final class ShadedRelief implements
org.opengis.style.ShadedRelief {
return false;
}
final ShadedRelief other = (ShadedRelief) obj;
- if (this.brightnessOnly != other.brightnessOnly) {
- return false;
- }
- return Objects.equals(this.reliefFactor, other.reliefFactor);
+ return this.brightnessOnly == other.brightnessOnly
+ && Objects.equals(this.reliefFactor, other.reliefFactor);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Stroke.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Stroke.java
index 8e93313278..474c931848 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Stroke.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Stroke.java
@@ -158,17 +158,7 @@ public final class Stroke implements
org.opengis.style.Stroke {
@Override
public int hashCode() {
- int hash = 5;
- hash = 47 * hash + Objects.hashCode(this.graphicFill);
- hash = 47 * hash + Objects.hashCode(this.graphicStroke);
- hash = 47 * hash + Objects.hashCode(this.color);
- hash = 47 * hash + Objects.hashCode(this.opacity);
- hash = 47 * hash + Objects.hashCode(this.width);
- hash = 47 * hash + Objects.hashCode(this.lineJoin);
- hash = 47 * hash + Objects.hashCode(this.lineCap);
- hash = 47 * hash + Arrays.hashCode(this.dashArray);
- hash = 47 * hash + Objects.hashCode(this.dashOffset);
- return hash;
+ return Objects.hash(graphicFill, graphicStroke, color, opacity, width,
lineJoin, lineCap, dashArray, dashOffset);
}
@Override
@@ -183,31 +173,15 @@ public final class Stroke implements
org.opengis.style.Stroke {
return false;
}
final Stroke other = (Stroke) obj;
- if (!Objects.equals(this.graphicFill, other.graphicFill)) {
- return false;
- }
- if (!Objects.equals(this.graphicStroke, other.graphicStroke)) {
- return false;
- }
- if (!Objects.equals(this.color, other.color)) {
- return false;
- }
- if (!Objects.equals(this.opacity, other.opacity)) {
- return false;
- }
- if (!Objects.equals(this.width, other.width)) {
- return false;
- }
- if (!Objects.equals(this.lineJoin, other.lineJoin)) {
- return false;
- }
- if (!Objects.equals(this.lineCap, other.lineCap)) {
- return false;
- }
- if (!Arrays.equals(this.dashArray, other.dashArray)) {
- return false;
- }
- return Objects.equals(this.dashOffset, other.dashOffset);
+ return Objects.equals(this.graphicFill, other.graphicFill)
+ && Objects.equals(this.graphicStroke, other.graphicStroke)
+ && Objects.equals(this.color, other.color)
+ && Objects.equals(this.opacity, other.opacity)
+ && Objects.equals(this.width, other.width)
+ && Objects.equals(this.lineJoin, other.lineJoin)
+ && Objects.equals(this.lineCap, other.lineCap)
+ && Arrays.equals(this.dashArray, other.dashArray)
+ && Objects.equals(this.dashOffset, other.dashOffset);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Style.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Style.java
index bbfab3232e..492aa0a301 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Style.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Style.java
@@ -81,11 +81,7 @@ public final class Style implements org.opengis.style.Style {
@Override
public int hashCode() {
- int hash = 7;
- hash = 71 * hash + Objects.hashCode(this.name);
- hash = 71 * hash + Objects.hashCode(this.description);
- hash = 71 * hash + Objects.hashCode(this.fts);
- return hash;
+ return Objects.hash(name, description, fts);
}
@Override
@@ -100,13 +96,9 @@ public final class Style implements org.opengis.style.Style
{
return false;
}
final Style other = (Style) obj;
- if (!Objects.equals(this.name, other.name)) {
- return false;
- }
- if (!Objects.equals(this.description, other.description)) {
- return false;
- }
- return Objects.equals(this.fts, other.fts);
+ return Objects.equals(this.name, other.name)
+ && Objects.equals(this.description, other.description)
+ && Objects.equals(this.fts, other.fts);
}
/**
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Symbolizer.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Symbolizer.java
index 9df6b5bcd0..a67a26e853 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Symbolizer.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/Symbolizer.java
@@ -75,12 +75,7 @@ public abstract class Symbolizer implements
org.opengis.style.Symbolizer {
@Override
public int hashCode() {
- int hash = 7;
- hash = 97 * hash + Objects.hashCode(this.name);
- hash = 97 * hash + Objects.hashCode(this.description);
- hash = 97 * hash + Objects.hashCode(this.geometry);
- hash = 97 * hash + Objects.hashCode(this.unit);
- return hash;
+ return Objects.hash(name, description, geometry, unit);
}
@Override
@@ -95,16 +90,10 @@ public abstract class Symbolizer implements
org.opengis.style.Symbolizer {
return false;
}
final Symbolizer other = (Symbolizer) obj;
- if (!Objects.equals(this.name, other.name)) {
- return false;
- }
- if (!Objects.equals(this.description, other.description)) {
- return false;
- }
- if (!Objects.equals(this.geometry, other.geometry)) {
- return false;
- }
- return Objects.equals(this.unit, other.unit);
+ return Objects.equals(this.name, other.name)
+ && Objects.equals(this.description, other.description)
+ && Objects.equals(this.geometry, other.geometry)
+ && Objects.equals(this.unit, other.unit);
}
static org.opengis.style.Symbolizer
tryCastOrCopy(org.opengis.style.Symbolizer s) {
diff --git
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/TextSymbolizer.java
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/TextSymbolizer.java
index c8a06137ef..6d7f4f6c78 100644
---
a/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/TextSymbolizer.java
+++
b/core/sis-portrayal/src/main/java/org/apache/sis/internal/style/TextSymbolizer.java
@@ -3,6 +3,7 @@
*/
package org.apache.sis.internal.style;
+import java.util.Objects;
import javax.measure.Unit;
import javax.measure.quantity.Length;
import org.opengis.feature.Feature;
@@ -98,6 +99,27 @@ public final class TextSymbolizer extends Symbolizer
implements org.opengis.styl
this.fill = fill;
}
+ @Override
+ public int hashCode() {
+ return super.hashCode() + Objects.hash(label, font, labelPlacement,
halo, fill);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof TextSymbolizer)) {
+ return false;
+ }
+ final TextSymbolizer other = (TextSymbolizer) obj;
+ return Objects.equals(this.label, other.label)
+ && Objects.equals(this.font, other.font)
+ && Objects.equals(this.labelPlacement, other.labelPlacement)
+ && Objects.equals(this.halo, other.halo)
+ && Objects.equals(this.fill, other.fill);
+ }
+
/**
* Cast or copy to an SIS implementation.
*