blob: 80be2db664365853b697da150620a4aa8a85bb51 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (24) on Mon Sep 29 10:48:08 CEST 2025 -->
<title>ComparisonMode (Apache SIS 1.5 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2025-09-29">
<meta name="description" content="declaration: module: org.apache.sis.util, package: org.apache.sis.util, enum: ComparisonMode">
<meta name="generator" content="javadoc/ClassWriter">
<meta name="keywords" content="org.apache.sis.util.ComparisonMode class">
<meta name="keywords" content="values()">
<meta name="keywords" content="valueOf()">
<meta name="keywords" content="isIgnoringMetadata()">
<meta name="keywords" content="isCompatibility()">
<meta name="keywords" content="isApproximate()">
<meta name="keywords" content="equalityLevel()">
<link rel="stylesheet" type="text/css" href="../../../../../resource-files/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../resource-files/stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../resource-files/sis.css" title="Style">
<script type="text/javascript" src="../../../../../script-files/script.js"></script>
<script type="text/javascript" src="../../../../../script-files/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="../../../../../script-files/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">const pathtoroot = "../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="nav-content">
<div class="nav-menu-button"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button></div>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/ComparisonMode.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../new-list.html">New</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../search.html">Search</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
</div>
<div class="sub-nav">
<div class="nav-content">
<ol class="sub-nav-list">
<li><a href="../../../../module-summary.html">org.apache.sis.util</a></li>
<li><a href="package-summary.html">org.apache.sis.util</a></li>
<li><a href="ComparisonMode.html" class="current-selection">ComparisonMode</a></li>
</ol>
<div class="nav-list-search">
<input type="text" id="search-input" disabled placeholder="Search" aria-label="Search in documentation" autocomplete="off">
<input type="reset" id="reset-search" disabled value="Reset">
</div>
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="main-grid">
<nav role="navigation" class="toc" aria-label="Table of contents">
<div class="toc-header">Contents&nbsp;
<input type="text" class="filter-input" disabled placeholder="Filter" aria-label="Filter table of contents" autocomplete="off">
<input type="reset" class="reset-filter" disabled value="Reset">
</div>
<button class="hide-sidebar"><span>Hide sidebar&nbsp;</span>&#10094;</button><button class="show-sidebar">&#10095;<span>&nbsp;Show sidebar</span></button>
<ol class="toc-list">
<li><a href="#" tabindex="0">Description</a></li>
<li><a href="#nested-class-summary" tabindex="0">Nested Class Summary</a></li>
<li><a href="#enum-constant-summary" tabindex="0">Enum Constant Summary</a></li>
<li><a href="#method-summary" tabindex="0">Method Summary</a></li>
<li><a href="#enum-constant-detail" tabindex="0">Enum Constant Details</a>
<ol class="toc-list">
<li><a href="#STRICT" tabindex="0">STRICT</a></li>
<li><a href="#BY_CONTRACT" tabindex="0">BY_CONTRACT</a></li>
<li><a href="#IGNORE_METADATA" tabindex="0">IGNORE_METADATA</a></li>
<li><a href="#COMPATIBILITY" tabindex="0">COMPATIBILITY</a></li>
<li><a href="#APPROXIMATE" tabindex="0">APPROXIMATE</a></li>
<li><a href="#ALLOW_VARIANT" tabindex="0">ALLOW_VARIANT</a></li>
<li><a href="#DEBUG" tabindex="0">DEBUG</a></li>
</ol>
</li>
<li><a href="#method-detail" tabindex="0">Method Details</a>
<ol class="toc-list">
<li><a href="#values()" tabindex="0">values()</a></li>
<li><a href="#valueOf(java.lang.String)" tabindex="0">valueOf(String)</a></li>
<li><a href="#isIgnoringMetadata()" tabindex="0">isIgnoringMetadata()</a></li>
<li><a href="#isCompatibility()" tabindex="0">isCompatibility()</a></li>
<li><a href="#isApproximate()" tabindex="0">isApproximate()</a></li>
<li><a href="#equalityLevel(java.lang.Object,java.lang.Object)" tabindex="0">equalityLevel(Object, Object)</a></li>
</ol>
</li>
</ol>
</nav>
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<h1 title="Enum Class ComparisonMode" class="title">Enum Class ComparisonMode</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
<div class="inheritance"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a>&lt;<a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a>&gt;
<div class="inheritance">ComparisonMode</div>
</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code>, <code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Comparable.html" title="class or interface in java.lang" class="external-link">Comparable</a>&lt;<a href="ComparisonMode.html" title="enum class in org.apache.sis.util">Comparison­Mode</a>&gt;</code>, <code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/constant/Constable.html" title="class or interface in java.lang.constant" class="external-link">Constable</a></code></dd>
</dl>
<hr>
<div class="horizontal-scroll">
<div class="type-signature"><span class="modifiers">public enum </span><span class="element-name type-name-label">ComparisonMode</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a>&lt;<a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a>&gt;</span></div>
<div class="block">Specifies the level of strictness when comparing two <a href="LenientComparable.html" title="interface in org.apache.sis.util"><code>Lenient­Comparable</code></a> objects for equality.
This enumeration allows users to specify which kind of differences can be tolerated between two objects:
differences in implementation class, differences in some kinds of property,
or slight difference in numerical values.
<p>This enumeration is <em>ordered</em> from stricter to more lenient levels:</p>
<ol>
<li><a href="#STRICT"><code>STRICT</code></a> – All attributes of the compared objects shall be strictly equal.</li>
<li><a href="#BY_CONTRACT"><code>BY_CONTRACT</code></a> – Only the attributes published in the interface contract need to be compared.</li>
<li><a href="#IGNORE_METADATA"><code>IGNORE_METADATA</code></a> – Only the attributes relevant to the object functionality are compared.</li>
<li><a href="#COMPATIBILITY"><code>COMPATIBILITY</code></a> – Like <code>IGNORE_METADATA</code>, but ignore also some structural changes for historical reasons.</li>
<li><a href="#APPROXIMATE"><code>APPROXIMATE</code></a> – Like <code>COMPATIBILITY</code>, with some tolerance threshold on numerical values.</li>
<li><a href="#ALLOW_VARIANT"><code>ALLOW_VARIANT</code></a> – Objects not really equal but related (e.g., <abbr>CRS</abbr> using different axis order).</li>
<li><a href="#DEBUG"><code>DEBUG</code></a> – Special mode for figuring out why two objects expected to be equal are not.</li>
</ol>
If two objects are equal at some level of strictness <var>E</var>,
then they shall also be equal at all levels listed after <var>E</var> in the above list.
For example, if two objects are equal at the <a href="#BY_CONTRACT"><code>BY_CONTRACT</code></a> level,
then they shall also be equal at the <a href="#IGNORE_METADATA"><code>IGNORE_METADATA</code></a> level
but not necessarily at the <a href="#STRICT"><code>STRICT</code></a> level.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.3</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="LenientComparable.html#equals(java.lang.Object,org.apache.sis.util.ComparisonMode)"><code>Lenient­Comparable​.equals(Object, Comparison­Mode)</code></a></li>
<li><a href="Utilities.html#deepEquals(java.lang.Object,java.lang.Object,org.apache.sis.util.ComparisonMode)"><code>Utilities​.deep­Equals(Object, Object, Comparison­Mode)</code></a></li>
</ul>
</dd>
</dl>
</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<li>
<section class="nested-class-summary" id="nested-class-summary">
<h2>Nested Class Summary</h2>
<div class="inherited-list">
<h3 id="nested-classes-inherited-from-class-java.lang.Enum">Nested classes/interfaces inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.EnumDesc.html" title="class or interface in java.lang" class="external-link">Enum​.Enum­Desc</a>&lt;<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.EnumDesc.html#type-param-E" title="class or interface in java.lang" class="external-link">E</a> extends <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a>&lt;<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.EnumDesc.html#type-param-E" title="class or interface in java.lang" class="external-link">E</a>&gt;&gt;</code></div>
</section>
</li>
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
<li>
<section class="constants-summary" id="enum-constant-summary">
<h2>Enum Constant Summary</h2>
<div class="caption"><span>Enum Constants</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Enum Constant</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code><a href="#ALLOW_VARIANT" class="member-name-link">ALLOW_VARIANT</a></code></div>
<div class="col-last even-row-color">
<div class="block">Most but not all attributes relevant to the object functionality are compared.</div>
</div>
<div class="col-first odd-row-color"><code><a href="#APPROXIMATE" class="member-name-link">APPROXIMATE</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Only the attributes relevant to compatibility are compared, with some tolerance threshold on numerical values.</div>
</div>
<div class="col-first even-row-color"><code><a href="#BY_CONTRACT" class="member-name-link">BY_CONTRACT</a></code></div>
<div class="col-last even-row-color">
<div class="block">Only the attributes published in some contract (typically a GeoAPI interface) need to be compared.</div>
</div>
<div class="col-first odd-row-color"><code><a href="#COMPATIBILITY" class="member-name-link">COMPATIBILITY</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Only the attributes relevant to the object functionality are compared, with a tolerance for some structural changes.</div>
</div>
<div class="col-first even-row-color"><code><a href="#DEBUG" class="member-name-link">DEBUG</a></code></div>
<div class="col-last even-row-color">
<div class="block">Asserts that two objects shall be approximately equal.</div>
</div>
<div class="col-first odd-row-color"><code><a href="#IGNORE_METADATA" class="member-name-link">IGNORE_METADATA</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Only the attributes relevant to the object functionality are compared.</div>
</div>
<div class="col-first even-row-color"><code><a href="#STRICT" class="member-name-link">STRICT</a></code></div>
<div class="col-last even-row-color">
<div class="block">All attributes of the compared objects shall be strictly equal.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel" aria-labelledby="method-summary-table-tab0">
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="ComparisonMode.html" title="enum class in org.apache.sis.util">Comparison­Mode</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#equalityLevel(java.lang.Object,java.lang.Object)" class="member-name-link">equality­Level</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;o1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;o2)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">If the two given objects are equal according one of the modes enumerated in this class,
then returns that mode.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isApproximate()" class="member-name-link">is­Approximate</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if this comparison uses a tolerance threshold.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isCompatibility()" class="member-name-link">is­Compatibility</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if this comparison accepts structural changes for compatibility reasons.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isIgnoringMetadata()" class="member-name-link">is­Ignoring­Metadata</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if this comparison ignores metadata.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="ComparisonMode.html" title="enum class in org.apache.sis.util">Comparison­Mode</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#valueOf(java.lang.String)" class="member-name-link">value­Of</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the enum constant of this class with the specified name.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="ComparisonMode.html" title="enum class in org.apache.sis.util">Comparison­Mode</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#values()" class="member-name-link">values</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns an array containing the constants of this enum class, in
the order they are declared.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Enum">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#compareTo(E)" title="class or interface in java.lang" class="external-link">compare­To</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#describeConstable()" title="class or interface in java.lang" class="external-link">describe­Constable</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#getDeclaringClass()" title="class or interface in java.lang" class="external-link">get­Declaring­Class</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#name()" title="class or interface in java.lang" class="external-link">name</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#ordinal()" title="class or interface in java.lang" class="external-link">ordinal</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#toString()" title="class or interface in java.lang" class="external-link">to­String</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#valueOf(java.lang.Class,java.lang.String)" title="class or interface in java.lang" class="external-link">value­Of</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">get­Class</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notify­All</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ ENUM CONSTANT DETAIL =========== -->
<li>
<section class="constant-details" id="enum-constant-detail">
<h2>Enum Constant Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="STRICT">
<h3>STRICT</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a></span>&nbsp;<span class="element-name">STRICT</span></div>
<div class="block">All attributes of the compared objects shall be strictly equal. This comparison mode
is equivalent to the <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link"><code>Object​.equals(Object)</code></a> method, and must be compliant with
the contract documented in that method. In particular, this comparison mode shall be
consistent with <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link"><code>Object​.hash­Code()</code></a> and be symmetric (<code>A​.equals(B)</code> implies
<code>B​.equals(A)</code>).
<h4 id="implementation-note-heading">Implementation note</h4>
In the <abbr>SIS</abbr> implementations, this comparison mode usually have the following
characteristics (not always, this is only typical):
<ul>
<li>The objects being compared need to be the same implementation class.</li>
<li>Private fields are compared directly instead of invoking public getter methods.</li>
</ul></div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link"><code>Object​.equals(Object)</code></a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="BY_CONTRACT">
<h3>BY_CONTRACT</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a></span>&nbsp;<span class="element-name">BY_CONTRACT</span></div>
<div class="block">Only the attributes published in some contract (typically a GeoAPI interface) need to be compared.
The implementation classes do not need to be the same and some private attributes may be ignored.
<p>Note that this comparison mode does <strong>not</strong> guarantee <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link"><code>Object​.hash­Code()</code></a>
consistency, neither comparison symmetry (i.e. <code>A​.equals(B)</code> and <code>B​.equals(A)</code> may
return different results if the <code>equals</code> methods are implemented differently).</p>
<h4 id="implementation-note-heading1">Implementation note</h4>
In the <abbr>SIS</abbr> implementations, this comparison mode usually have the following
characteristics (not always, this is only typical):
<ul>
<li>The objects being compared need to implement the same GeoAPI interfaces.</li>
<li>Public getter methods are used (no direct access to private fields).</li>
</ul></div>
</div>
</section>
</li>
<li>
<section class="detail" id="IGNORE_METADATA">
<h3>IGNORE_METADATA</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a></span>&nbsp;<span class="element-name">IGNORE_METADATA</span></div>
<div class="block">Only the attributes relevant to the object functionality are compared. Attributes that
are only informative can be ignored. This comparison mode is typically less strict than
<a href="#BY_CONTRACT"><code>BY_CONTRACT</code></a>.
<h4 id="application-to-coordinate-reference-systems-heading">Application to coordinate reference systems</h4>
If the objects being compared are <a href="https://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/crs/CoordinateReferenceSystem.html" title="class or interface in org.opengis.referencing.crs" class="external-link"><code>Coordinate­Reference­System</code></a> instances,
then only the properties impacting coordinate values shall be compared.
Metadata like the <a href="https://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/IdentifiedObject.html#getIdentifiers()" title="class or interface in org.opengis.referencing" class="external-link">identifiers</a>
or the <a href="../../../../../org.apache.sis.referencing/org/apache/sis/referencing/AbstractIdentifiedObject.html#getDomains()">domain of validity</a>,
which have no impact on the coordinates being calculated, shall be ignored.
<h4 id="application-to-coordinate-operations-heading">Application to coordinate operations</h4>
If the objects being compared are <a href="https://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Math­Transform</code></a> instances,
then two transforms defined in a different way may be considered equivalent.
For example, it is possible to define a Mercator projection in different ways,
named "variant A", "variant B" and "variant C" in EPSG dataset, each having their own set of parameters.
The <a href="#STRICT"><code>STRICT</code></a> or <a href="#BY_CONTRACT"><code>BY_CONTRACT</code></a> modes shall consider two projections as equal only if their
<a href="../../../../../org.apache.sis.referencing/org/apache/sis/referencing/operation/transform/AbstractMathTransform.html#getParameterValues()">parameter values</a> are strictly identical, while the <code>IGNORE_METADATA</code> mode can consider
those objects as equivalent despite difference in the set of parameters,
as long as coordinate operations still produce the same results.
<h5 id="example-heading">Example</h5>
A <q>Mercator (variant B)</q> projection with a <i>standard parallel</i> value of 60° produces the
same results as a <q>Mercator (variant A)</q> projection with a <i>scale factor</i> value of 0.5.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#isIgnoringMetadata()"><code>is­Ignoring­Metadata()</code></a></li>
<li><a href="Utilities.html#equalsIgnoreMetadata(java.lang.Object,java.lang.Object)"><code>Utilities​.equals­Ignore­Metadata(Object, Object)</code></a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="COMPATIBILITY">
<h3>COMPATIBILITY</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a></span>&nbsp;<span class="element-name">COMPATIBILITY</span></div>
<div class="block">Only the attributes relevant to the object functionality are compared, with a tolerance for some structural changes.
The changes may exist for historical reasons, or for compatibility with common practice in other software.
However, the changes should not have a practical impact on the numerical results of coordinate operations.
For example, changes of input or output axis order is not accepted by this comparison mode.
<h4 id="application-to-datum-ensembles-heading">Application to datum ensembles</h4>
Two Coordinate Reference Systems (<abbr>CRS</abbr>) may be considered compatible when
one <abbr>CRS</abbr> is associated to a datum and the other <abbr>CRS</abbr> is associated to a datum ensemble,
but the former can be considered as the <a href="../../../../../org.apache.sis.referencing/org/apache/sis/referencing/datum/DatumOrEnsemble.html#isLegacyDatum(org.apache.sis.referencing.datum.DefaultDatumEnsemble,org.opengis.referencing.datum.Datum,org.apache.sis.util.ComparisonMode)">legacy definition</a> of the latter. This comparison mode can check, among other criteria,
whether the datum and the datum ensemble share a common authority code.
<p><b>Example:</b> <code>EPSG:9:4326</code> and <code>EPSG:10:4326</code>, which are both the same (at least conceptually)
geographic <abbr>CRS</abbr> associated to the authority code 4326 in the <abbr>EPSG</abbr> geodetic dataset,
but as defined in version 9 and 10 respectively of the <abbr>EPSG</abbr> database.
They are the <abbr>CRS</abbr> definitions before and after the introduction of datum ensemble in the schema.</p>
<h4 id="application-to-dynamic-reference-frames-heading">Application to dynamic reference frames</h4>
Two Reference Frames may be considered compatible despite one frame being static and the other frame being dynamic.
This comparison mode can check, among other criteria, whether the two reference frames share a common authority code
or have an <a href="../../../../../org.apache.sis.referencing/org/apache/sis/referencing/IdentifiedObjects.html#isHeuristicMatchForName(org.opengis.referencing.IdentifiedObject,java.lang.String)">equivalent name</a>.
<p><b>Example:</b> the "WGS 1972" reference frame as defined in versions 9 and 10 of <abbr>EPSG</abbr> database.</p></div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.5</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="#isCompatibility()"><code>is­Compatibility()</code></a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="APPROXIMATE">
<h3>APPROXIMATE</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a></span>&nbsp;<span class="element-name">APPROXIMATE</span></div>
<div class="block">Only the attributes relevant to compatibility are compared, with some tolerance threshold on numerical values.
The threshold is implementation dependent, but the current <abbr>SIS</abbr> implementation generally aims for
a precision of 1 centimeter in the linear and angular parameter values for a planet of the size of Earth.
<h4 id="application-to-coordinate-operations-heading1">Application to coordinate operations</h4>
If two <a href="https://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Math­Transform</code></a> objects are considered equal according this mode, then for any given identical source position,
the two compared transforms shall compute at least approximately the same target position.
A small difference is tolerated between the target coordinates calculated by the two math transforms.
How small is “small” is implementation dependent — the threshold cannot be specified in the current
implementation, because of the non-linear nature of map projections.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="#isApproximate()"><code>is­Approximate()</code></a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="ALLOW_VARIANT">
<h3>ALLOW_VARIANT</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a></span>&nbsp;<span class="element-name">ALLOW_VARIANT</span></div>
<div class="block">Most but not all attributes relevant to the object functionality are compared.
This comparison mode is equivalent to <a href="#APPROXIMATE"><code>APPROXIMATE</code></a>, except that it
ignores some aspects that may differ between objects not equal but related.
Below is a list of examples where the objects being compared would be
considered different according the other modes such as <a href="#APPROXIMATE"><code>APPROXIMATE</code></a>,
but are considered equivalent according this <code>ALLOW_VARIANT</code> mode.
<ul class="verbose">
<li>Two Coordinate Reference Systems (<abbr>CRS</abbr>) with the same axes but in different order.
<b>Example:</b> two geographic <abbr>CRS</abbr>s with the same attributes but with
(<var>latitude</var>, <var>longitude</var>) axes in one case and
(<var>longitude</var>, <var>latitude</var>) axes in the other case.</li>
</ul></div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.7</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="DEBUG">
<h3>DEBUG</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="annotations"><a href="Debug.html" title="annotation interface in org.apache.sis.util">@Debug</a>
</span><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a></span>&nbsp;<span class="element-name">DEBUG</span></div>
<div class="block">Asserts that two objects shall be approximately equal.
The same comparison as <a href="#APPROXIMATE"><code>APPROXIMATE</code></a> is performed,
except that an <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/AssertionError.html" title="class or interface in java.lang" class="external-link"><code>Assertion­Error</code></a> is thrown if the two objects are not equal and assertions are enabled.
The exception message and stack trace help to locate which attributes are not equal.
This mode is typically used in assertions like below:
<div class="snippet-container"><button class="copy snippet-copy" aria-label="Copy snippet" onclick="copySnippet(this)"><span data-copied="Copied!">Copy</span><img src="../../../../../resource-files/copy.svg" alt="Copy snippet"></button>
<pre class="snippet" id="snippet-DEBUG1"><code class="language-java">assert Utilities.deepEquals(object1, object2, ComparisonMode.DEBUG);
</code></pre>
</div>
Note that a comparison in <code>DEBUG</code> mode may still return <code>false</code> without
throwing an exception, since not all corner cases are tested. The exception is only
intended to provide more details for some common cases.</div>
</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="values()">
<h3>values</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a>[]</span>&nbsp;<span class="element-name">values</span>()</div>
<div class="block">Returns an array containing the constants of this enum class, in
the order they are declared.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>an array containing the constants of this enum class, in the order they are declared</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="valueOf(java.lang.String)">
<h3>valueOf</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a></span>&nbsp;<span class="element-name">valueOf</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Returns the enum constant of this class with the specified name.
The string must match <i>exactly</i> an identifier used to declare an
enum constant in this class. (Extraneous whitespace characters are
not permitted.)</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - the name of the enum constant to be returned.</dd>
<dt>Returns:</dt>
<dd>the enum constant with the specified name</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if this enum class has no constant with the specified name</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">Null­Pointer­Exception</a></code> - if the argument is null</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="isIgnoringMetadata()">
<h3>isIgnoringMetadata</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isIgnoringMetadata</span>()</div>
<div class="block">Returns <code>true</code> if this comparison ignores metadata.
This method returns <code>true</code> for <a href="#IGNORE_METADATA"><code>IGNORE_METADATA</code></a>, <a href="#COMPATIBILITY"><code>COMPATIBILITY</code></a>, <a href="#APPROXIMATE"><code>APPROXIMATE</code></a>,
<a href="#ALLOW_VARIANT"><code>ALLOW_VARIANT</code></a> and <a href="#DEBUG"><code>DEBUG</code></a>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>whether this comparison ignores metadata.</dd>
<dt>Since:</dt>
<dd>0.6</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="isCompatibility()">
<h3>isCompatibility</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isCompatibility</span>()</div>
<div class="block">Returns <code>true</code> if this comparison accepts structural changes for compatibility reasons.
This method returns <code>true</code> for <a href="#COMPATIBILITY"><code>COMPATIBILITY</code></a>, <a href="#APPROXIMATE"><code>APPROXIMATE</code></a>, <a href="#ALLOW_VARIANT"><code>ALLOW_VARIANT</code></a>
and <a href="#DEBUG"><code>DEBUG</code></a>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>whether this comparison accepts structural changes for compatibility reasons.</dd>
<dt>Since:</dt>
<dd>1.5</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="isApproximate()">
<h3>isApproximate</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isApproximate</span>()</div>
<div class="block">Returns <code>true</code> if this comparison uses a tolerance threshold.
This method returns <code>true</code> for <a href="#APPROXIMATE"><code>APPROXIMATE</code></a>, <a href="#ALLOW_VARIANT"><code>ALLOW_VARIANT</code></a> and <a href="#DEBUG"><code>DEBUG</code></a>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>whether this comparison uses a tolerance threshold.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="equalityLevel(java.lang.Object,java.lang.Object)">
<h3>equalityLevel</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a></span>&nbsp;<span class="element-name">equalityLevel</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;o1,
<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;o2)</span></div>
<div class="block">If the two given objects are equal according one of the modes enumerated in this class,
then returns that mode. Otherwise returns <code>null</code>.
<p><b>Note:</b> this method never return the <a href="#DEBUG"><code>DEBUG</code></a> mode.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>o1</code> - the first object to compare, or <code>null</code>.</dd>
<dd><code>o2</code> - the second object to compare, or <code>null</code>.</dd>
<dt>Returns:</dt>
<dd>the most suitable comparison mode, or <code>null</code> if the two given objects
are not equal according any mode in this enumeration.</dd>
</dl>
</div>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</body>
</html>