001package org.intellimate.izou.identification;
002
003/**
004 * Makes a class identifiable by forcing implementations to set an ID.
005 */
006public interface Identifiable {
007    /**
008     * An ID must always be unique.
009     * A Class like Activator or OutputPlugin can just provide their .class.getCanonicalName()
010     * If you have to implement this interface multiple times, just concatenate unique Strings to
011     * .class.getCanonicalName()
012     * @return A String containing an ID
013     */
014    abstract public String getID();
015
016    /**
017     * checks whether this instance is the owner of this Identification
018     * @param identification the identification to check
019     * @return true if the same, false if not
020     */
021    default boolean isOwner(Identification identification) {
022        return getID().equals(identification.getID());
023    }
024}