Class RedirectLocations


  • public final class RedirectLocations
    extends java.lang.Object
    This class represents a collection of URIs used as redirect locations.
    Since:
    4.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.net.URI> all  
      private java.util.Set<java.net.URI> unique  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.net.URI uri)
      Adds a new URI to the collection.
      void clear()  
      boolean contains​(java.net.URI uri)
      Test if the URI is present in the collection.
      java.net.URI get​(int index)
      Returns the URI at the specified position in this list.
      java.util.List<java.net.URI> getAll()
      Returns all redirect URIs in the order they were added to the collection.
      int size()
      Returns the number of elements in this list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • unique

        private final java.util.Set<java.net.URI> unique
      • all

        private final java.util.List<java.net.URI> all
    • Constructor Detail

      • RedirectLocations

        public RedirectLocations()
    • Method Detail

      • contains

        public boolean contains​(java.net.URI uri)
        Test if the URI is present in the collection.
      • add

        public void add​(java.net.URI uri)
        Adds a new URI to the collection.
      • getAll

        public java.util.List<java.net.URI> getAll()
        Returns all redirect URIs in the order they were added to the collection.
        Returns:
        list of all URIs
        Since:
        4.1
      • get

        public java.net.URI get​(int index)
        Returns the URI at the specified position in this list.
        Parameters:
        index - index of the location to return
        Returns:
        the URI at the specified position in this list
        Throws:
        java.lang.IndexOutOfBoundsException - if the index is out of range ( index &lt; 0 || index &gt;= size())
        Since:
        4.3
      • size

        public int size()
        Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
        Returns:
        the number of elements in this list
        Since:
        4.3
      • clear

        public void clear()