Class FilteredCollection

java.lang.Object
org.dspace.contentreport.FilteredCollection
All Implemented Interfaces:
Serializable, Cloneable

public class FilteredCollection extends Object implements Cloneable, Serializable
This class represents an entry in the Filtered Collections report.
Author:
Jean-François Morin (Université Laval)
See Also:
  • Constructor Details

    • FilteredCollection

      public FilteredCollection()
  • Method Details

    • of

      public static FilteredCollection of(String label, String handle, String communityLabel, String communityHandle, int totalItems, int allFiltersValue, Map<Filter,Integer> values, boolean doSeal)
      Shortcut method that builds a FilteredCollectionRest instance from its building blocks.
      Parameters:
      label - Name of the collection
      handle - Handle of the collection
      communityLabel - Name of the owning community
      communityHandle - Handle of the owning community
      totalItems - Total number of items in the collection
      allFiltersValue - Number of items in the collection that match all requested filters
      values - Number of filtered items per requested filter in the collection
      doSeal - true if the collection must be sealed immediately
      Returns:
      a FilteredCollectionRest instance built from the provided parameters
    • getValues

      public Map<Filter,Integer> getValues()
      Returns the item counts per filter. If this object is sealed, a defensive copy will be returned.
      Returns:
      the item counts per filter
    • addValue

      public void addValue(Filter filter, int delta)
      Increments a filtered item count for a given filter.
      Parameters:
      filter - Filter to add to the requested filters in this collection
      delta - Number by which the filtered item count must be incremented for the requested filter
    • setValues

      public void setValues(Map<? extends Filter,? extends Integer> values)
      Sets all filtered item counts for this collection. The contents are copied into this object's internal Map, which is protected against further tampering with the provided Map.
      Parameters:
      values - Values that replace the current ones
    • getLabel

      public String getLabel()
    • setLabel

      public void setLabel(String label)
    • getHandle

      public String getHandle()
    • setHandle

      public void setHandle(String handle)
    • getCommunityLabel

      public String getCommunityLabel()
    • setCommunityLabel

      public void setCommunityLabel(String communityLabel)
    • getCommunityHandle

      public String getCommunityHandle()
    • setCommunityHandle

      public void setCommunityHandle(String communityHandle)
    • getTotalItems

      public int getTotalItems()
    • setTotalItems

      public void setTotalItems(int totalItems)
    • getAllFiltersValue

      public int getAllFiltersValue()
    • addAllFiltersValue

      public void addAllFiltersValue(int delta)
      Increments the count of items matching all filters.
      Parameters:
      delta - Number by which the count must be incremented
    • setAllFiltersValue

      public void setAllFiltersValue(int allFiltersValue)
      Replaces the count of items matching all filters.
      Parameters:
      allFiltersValue - Number that replaces the current item count
    • getSealed

      public boolean getSealed()
    • seal

      public void seal()
      Seals this filtered collection object. No changes to this object can be made afterwards. Any attempt will throw an IllegalStateException.
    • clone

      public FilteredCollection clone()
      Returns a non-sealed clone of this filtered collection record.
      Overrides:
      clone in class Object
      Returns:
      a new non-sealed FilteredCollectionRest instance containing all attribute values of this object