Interface ResourceCollection

  • All Superinterfaces:
    Iterable<Resource>

    public interface ResourceCollection
    extends Iterable<Resource>
    Read-only Iterable interface with some read-only Collection/List operations such as size() or get(int).
    • Method Detail

      • getCollection

        Collection<Resource> getCollection()
        Returns a read-only collection over elements of type Resource.

        This method is provided for templating language such as Freemarker because Freemarker doesn't allow to list or iterator an Iterable directly as of v2.3.x. for instance.

        Returns:
        a resource collection.
      • size

        int size()
        Returns the number of elements in this resource collection. If this resource collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
        Returns:
        the number of elements in this resource collection
      • get

        Resource get​(int index)
        Returns the resource element at the specified position in this resource collection.
        Parameters:
        index - index of the resource element to return
        Returns:
        the resource element at the specified position in this resource collection
        Throws:
        IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())