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