Class PermissionCheckedCollection.PermissionCheckedCollectionMixin<T>

  • Type Parameters:
    T - the type of the Collection in use
    All Implemented Interfaces:
    Serializable, PermissionCheckedCollection<T>, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.aop.DynamicIntroductionAdvice, org.springframework.aop.IntroductionInfo, org.springframework.aop.IntroductionInterceptor
    Enclosing interface:
    PermissionCheckedCollection<T>

    public static class PermissionCheckedCollection.PermissionCheckedCollectionMixin<T>
    extends org.springframework.aop.support.DelegatingIntroductionInterceptor
    implements PermissionCheckedCollection<T>
    Helper 'introduction' to allow simple addition of the PermissionCheckedCollection interface to existing collections.
    Since:
    4.0
    Author:
    Derek Hulley
    See Also:
    Serialized Form
    • Method Detail

      • isCutOff

        public boolean isCutOff()
        Description copied from interface: PermissionCheckedCollection
        Check if the results have been truncated by permission check limits.
        Specified by:
        isCutOff in interface PermissionCheckedCollection<T>
        Returns:
        true - if the results (usually a collection) have been cut off by permission check limits
      • sizeUnchecked

        public int sizeUnchecked()
        Description copied from interface: PermissionCheckedCollection
        Get the number of objects in the original (unfiltered) collection that did not have any permission checks.
        Specified by:
        sizeUnchecked in interface PermissionCheckedCollection<T>
        Returns:
        number of entries from the original collection that were not checked
      • create

        public static final <TT> Collection<TT> create​(Collection<TT> collection,
                                                       Collection<?> checkedSource)
        Helper method to create a PermissionCheckedCollection from an existing Collection by applying the same values as present on a potentially permission-checked source. If the existing checked source is NOT permission-checked, then the collection will not be decorated.
        Type Parameters:
        TT - the type of the Collection
        Parameters:
        collection - the Collection to proxy
        checkedSource - a collection that might implement PermissionCheckedCollection
        Returns:
        a Collection of the same type but including the PermissionCheckedCollection interface
      • create

        public static final <TT> Collection<TT> create​(Collection<TT> collection,
                                                       boolean isCutOff,
                                                       int sizeUnchecked,
                                                       int sizeOriginal)
        Helper method to create a PermissionCheckedCollection from an existing Collection
        Type Parameters:
        TT - the type of the Collection
        Parameters:
        collection - the Collection to proxy
        isCutOff - true if permission checking was cut off before completion
        sizeUnchecked - number of entries from the original collection that were not checked
        sizeOriginal - number of entries in the original, pre-checked collection
        Returns:
        a Collection of the same type but including the PermissionCheckedCollection interface