Interface ComparableItem<T extends ComparableItem<T>>

Type Parameters:
T - type of item.

public interface ComparableItem<T extends ComparableItem<T>>
Interface of items that can be compared to other items in a collection.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equalContent(T other)
    Determines whether the content of this item is equal to the content of another item.
    boolean
    equals(Object other)
    Determines whether this item is equal to another item (e.g., has the same identifier).
  • Method Details

    • equals

      boolean equals(Object other)
      Determines whether this item is equal to another item (e.g., has the same identifier). This method MUST NOT check if the content of all items is equal, only if they represent the same item.
      Overrides:
      equals in class Object
      Parameters:
      other - another item to be compared.
      Returns:
      true if both items are equal, false otherwise.
    • equalContent

      boolean equalContent(T other)
      Determines whether the content of this item is equal to the content of another item.
      Parameters:
      other - another item to be compared.
      Returns:
      true if the content of both items is equal, false otherwise.