Package org.dspace.contentreport
Class FilteredCollection
java.lang.Object
org.dspace.contentreport.FilteredCollection
- All Implemented Interfaces:
Serializable,Cloneable
This class represents an entry in the Filtered Collections report.
- Author:
- Jean-François Morin (Université Laval)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllFiltersValue(int delta) Increments the count of items matching all filters.voidIncrements a filtered item count for a given filter.clone()Returns a non-sealed clone of this filtered collection record.intgetLabel()booleanintReturns the item counts per filter.static FilteredCollectionof(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.voidseal()Seals this filtered collection object.voidsetAllFiltersValue(int allFiltersValue) Replaces the count of items matching all filters.voidsetCommunityHandle(String communityHandle) voidsetCommunityLabel(String communityLabel) voidvoidvoidsetTotalItems(int totalItems) voidSets all filtered item counts for this collection.
-
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 collectionhandle- Handle of the collectioncommunityLabel- Name of the owning communitycommunityHandle- Handle of the owning communitytotalItems- Total number of items in the collectionallFiltersValue- Number of items in the collection that match all requested filtersvalues- Number of filtered items per requested filter in the collectiondoSeal- true if the collection must be sealed immediately- Returns:
- a FilteredCollectionRest instance built from the provided parameters
-
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
Increments a filtered item count for a given filter.- Parameters:
filter- Filter to add to the requested filters in this collectiondelta- Number by which the filtered item count must be incremented for the requested filter
-
setValues
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
-
setLabel
-
getHandle
-
setHandle
-
getCommunityLabel
-
setCommunityLabel
-
getCommunityHandle
-
setCommunityHandle
-
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
Returns a non-sealed clone of this filtered collection record.
-