Class Links


  • @Deprecated
    public class Links
    extends Object
    Deprecated.
    All supported versions of Lyo define hashCode and equals methods for Link, methods in this class are now useless. This class will be removed in next version.
    Provides facilities for operations that involve Link equality.

    The Link class does not define a equals() method. Therefore two Link instances are not equal even if they hold the same URI, which complicates the handling of Links in a Collection. Methods defined in this class consider two Link instances to be equal if they do hold the same URI (regardless of their optional label).

    Since:
    1.3.0
    • Method Detail

      • equals

        @Deprecated
        public static boolean equals​(Link link1,
                                     Link link2)
        Deprecated.
        All supported versions of Lyo define equals method for Link. Developer should now use Objects.equal(Object, Object). This method will be removed in next version.
        Determines whether two possibly-null Link hold the same URI.
        Parameters:
        link1 - a first Link, possibly null
        link2 - a second Link, possibly null
        Returns:
        true if both links are null or if they both hold the same URI, false otherwise.
      • contains

        @Deprecated
        public static boolean contains​(Collection<Link> collection,
                                       Link link)
        Deprecated.
        All supported versions of Lyo define equals method for Link. Developer should now use Collection.contains(Object). This method will be removed in next version.
        Returns true if the collection contains a Link holding the same URI as the one of the specific Link.
        Parameters:
        collection - a collection containing Links.
        link - element whose presence in this collection is to be tested
        Returns:
        null if the collection contains a Link holding the same URI as the one of the specific Link, false otherwise.
      • containsAll

        @Deprecated
        public static boolean containsAll​(Collection<Link> collection,
                                          Collection<Link> subCollection)
        Deprecated.
        All supported versions of Lyo define equals method for Link. Developer should now use Collection.containsAll(Collection). This method will be removed in next version.
        Returns true if the collection contains Links holding all URIs referenced in the specified sub-collection.
        Parameters:
        collection - a collection containing Links.
        subCollection - another collection of Links to be checked for containment.
        Returns:
        true if the collection contains Links holding all URIs referenced in the specified sub-collection, false otherwise.
      • indexOf

        @Deprecated
        public static int indexOf​(List<Link> list,
                                  Link link)
        Deprecated.
        All supported versions of Lyo define equals method for Link. Developer should now use List.indexOf(Object). This method will be removed in next version.
        Returns the index of the first occurrence of a Link holding the same URI as the one of the specific Link.
        Parameters:
        list - a list of Links.
        link - the link whose index in the list is to determine.
        Returns:
        the index of the first occurrence of a Link holding the same URI as the one of the specific Link, -1 if not present in the list.
      • lastIndexOf

        @Deprecated
        public static int lastIndexOf​(List<Link> list,
                                      Link link)
        Deprecated.
        All supported versions of Lyo define equals method for Link. Developer should now use List.lastIndexOf(Object). This method will be removed in next version.
        Returns the index of the last occurrence of a Link holding the same URI as the one of the specific Link.
        Parameters:
        list - a list of Links.
        link - the link whose index in the list is to determine.
        Returns:
        the index of the last occurrence of a Link holding the same URI as the one of the specific Link, -1 if not present in the list.
      • remove

        @Deprecated
        public static boolean remove​(Collection<Link> collection,
                                     Link link)
        Deprecated.
        All supported versions of Lyo define equals method for Link. Developer should now use Collection.remove(Object). This method will be removed in next version.
        Removes a single Link instance holding the same URI as the one of the specific Link.
        Parameters:
        collection - a collection containing Links.
        link - a Link to remove from the collection.
        Returns:
        true if a Link was removed as a result of this call.
      • removeAll

        @Deprecated
        public static boolean removeAll​(Collection<Link> collection,
                                        Collection<Link> subCollection)
        Deprecated.
        All supported versions of Lyo define equals method for Link. Developer should now use Collection.removeAll(Collection). This method will be removed in next version.
        Removes all Link instances holding a URI referenced in the specified sub-collection.
        Parameters:
        collection - a collection containing Links.
        subCollection - a collection of Links to remove in the first collection.
        Returns:
        true if at least one Link was removed as a result of this call.
      • retainAll

        @Deprecated
        public static boolean retainAll​(Collection<Link> collection,
                                        Collection<Link> subCollection)
        Deprecated.
        All supported versions of Lyo define equals method for Link. Developer should now use Collection.retainAll(Collection). This method will be removed in next version.
        Retains only Link instances holding a URI referenced in the specified sub-collection.
        Parameters:
        collection - a collection containing Links.
        subCollection - a collection of Links to retain in the first collection.
        Returns:
        true if at least one Link was removed as a result of this call.