001/*
002 * Copyright 2020 Global Biodiversity Information Facility (GBIF)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.gbif.api.model.registry;
017
018/**
019 * An interface to allow model objects to offer a consistent lenient equality check.
020 * Implementations are free to declare what this means in the specific context, but it is expected that this be used to
021 * imply a business logic unique. For example, contact details that are not yet persisted might be equal to a persisted
022 * contact in every way except that the server controlled fields of key, createdDate, modifiedDate etc are not yet
023 * present.
024 */
025public interface LenientEquals<T> {
026
027  /**
028   * Leniently tests if the objects are the same.
029   * Implementors should declare what this means in practice.
030   *
031   * @param other To compare against
032   * @return true if... <insert implementation definition>
033   */
034  boolean lenientEquals(T other);
035}