Class SimpleActivityRecordSet<RecordType extends ActivityRecord>
- java.lang.Object
-
- org.apache.guacamole.net.auth.simple.SimpleActivityRecordSet<RecordType>
-
- Type Parameters:
RecordType
- The type of ActivityRecord contained within this set.
- All Implemented Interfaces:
ActivityRecordSet<RecordType>
public class SimpleActivityRecordSet<RecordType extends ActivityRecord> extends Object implements ActivityRecordSet<RecordType>
An immutable and empty ActivityRecordSet.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.guacamole.net.auth.ActivityRecordSet
ActivityRecordSet.SortableProperty
-
-
Constructor Summary
Constructors Constructor Description SimpleActivityRecordSet()
Create a new SimpleActivityRecordSet that contains an empty set of records.SimpleActivityRecordSet(Collection<? extends RecordType> records)
Create a new SimpleActivityRecordSet that contains the provided records which will back this record set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<RecordType>
asCollection()
Returns all records within this set as a standard Collection.ActivityRecordSet<RecordType>
contains(String value)
Returns the subset of records which contain the given value.ActivityRecordSet<RecordType>
limit(int limit)
Returns the subset of records containing only the firstlimit
records.ActivityRecordSet<RecordType>
sort(ActivityRecordSet.SortableProperty property, boolean desc)
Returns a ActivityRecordSet containing identically the records within this set, sorted according to the specified criteria.
-
-
-
Constructor Detail
-
SimpleActivityRecordSet
public SimpleActivityRecordSet()
Create a new SimpleActivityRecordSet that contains an empty set of records.
-
SimpleActivityRecordSet
public SimpleActivityRecordSet(Collection<? extends RecordType> records)
Create a new SimpleActivityRecordSet that contains the provided records which will back this record set.- Parameters:
records
- The records that this SimpleActivityRecordSet should contain.
-
-
Method Detail
-
asCollection
public Collection<RecordType> asCollection() throws org.apache.guacamole.GuacamoleException
Description copied from interface:ActivityRecordSet
Returns all records within this set as a standard Collection.- Specified by:
asCollection
in interfaceActivityRecordSet<RecordType extends ActivityRecord>
- Returns:
- A collection containing all records within this set.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while retrieving the records within this set.
-
contains
public ActivityRecordSet<RecordType> contains(String value) throws org.apache.guacamole.GuacamoleException
Description copied from interface:ActivityRecordSet
Returns the subset of records which contain the given value. The properties and semantics involved with determining whether a particular record "contains" the given value is implementation dependent. This function may affect the contents of the current ActivityRecordSet. The contents of the current ActivityRecordSet should NOT be relied upon after this function is called.- Specified by:
contains
in interfaceActivityRecordSet<RecordType extends ActivityRecord>
- Parameters:
value
- The value which all records within the resulting subset should contain.- Returns:
- The subset of records which contain the specified value.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while restricting the current subset.
-
limit
public ActivityRecordSet<RecordType> limit(int limit) throws org.apache.guacamole.GuacamoleException
Description copied from interface:ActivityRecordSet
Returns the subset of records containing only the firstlimit
records. If the subset has fewer thanlimit
records, then this function has no effect. This function may also affect the contents of the current ActivityRecordSet. The contents of the current ActivityRecordSet should NOT be relied upon after this function is called.- Specified by:
limit
in interfaceActivityRecordSet<RecordType extends ActivityRecord>
- Parameters:
limit
- The maximum number of records that the new subset should contain.- Returns:
- The subset of records that containing only the first
limit
records. - Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while limiting the current subset.
-
sort
public ActivityRecordSet<RecordType> sort(ActivityRecordSet.SortableProperty property, boolean desc) throws org.apache.guacamole.GuacamoleException
Description copied from interface:ActivityRecordSet
Returns a ActivityRecordSet containing identically the records within this set, sorted according to the specified criteria. The sort operation performed is guaranteed to be stable with respect to any past call to sort(). This function may also affect the contents of the current ActivityRecordSet. The contents of the current ActivityRecordSet should NOT be relied upon after this function is called.- Specified by:
sort
in interfaceActivityRecordSet<RecordType extends ActivityRecord>
- Parameters:
property
- The property by which the records within the resulting set should be sorted.desc
- Whether the records should be sorted according to the specified property in descending order. If false, records will be sorted according to the specified property in ascending order.- Returns:
- The ActivityRecordSet, sorted according to the specified criteria.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while sorting the current subset, or if the given property is not supported by the implementation.
-
-