Class GenericObjectWrapper<T extends DataObject>

    • Constructor Detail

      • GenericObjectWrapper

        protected GenericObjectWrapper​(T object)
        Constructor of the class GenericObjectWrapper.
        Parameters:
        object - The object contained in the GenericObjectWrapper.
    • Method Detail

      • wrap

        protected static <U extends DataObject,​V extends GenericObjectWrapper<U>,​W extends Comparable<W>> List<V> wrap​(Collection<U> objects,
                                                                                                                                   Function<? super U,​? extends V> mapper,
                                                                                                                                   Function<? super V,​? extends W> sorter)
        Converts a DataObject list to a ObjectWrapper list, sorted by sorter.
        Type Parameters:
        U - The type of input (extends DataObject).
        V - The type of output (extends ObjectWrapper).
        W - The type used to sort the output.
        Parameters:
        objects - The DataObject list.
        mapper - The method used to map objects.
        sorter - The method used to sort the objects.
        Returns:
        See above.
      • wrap

        protected static <U extends DataObject,​V extends GenericObjectWrapper<U>> List<V> wrap​(Collection<U> objects,
                                                                                                     Function<? super U,​? extends V> mapper)
        Converts a DataObject list to a ObjectWrapper list, sorted by sorter.
        Type Parameters:
        U - The type of input (extends DataObject).
        V - The type of output (extends ObjectWrapper).
        Parameters:
        objects - The DataObject list.
        mapper - The method used to map objects.
        Returns:
        See above.
      • distinct

        public static <T extends GenericObjectWrapper<?>> List<T> distinct​(Collection<? extends T> objects)
        Only keeps objects with different IDs in a collection.
        Type Parameters:
        T - The objects type.
        Parameters:
        objects - A collection of objects.
        Returns:
        Distinct objects list, sorted by ID.
      • getId

        public long getId()
        Gets the object id
        Returns:
        id.
      • getCreated

        public Timestamp getCreated()
        Gets the object creation date
        Returns:
        creation date.
      • getGroupId

        public Long getGroupId()
        Gets the group ID
        Returns:
        group id.
      • toString

        public String toString()
        Overridden to return the name of the class and the object id.
        Overrides:
        toString in class Object
      • canAnnotate

        public boolean canAnnotate()
        Returns true if the object can be annotated false otherwise, depending on permissions level.
        Returns:
        See above.
      • canEdit

        public boolean canEdit()
        Returns true if the object can be edited by the user currently logged in false otherwise, depending on permissions level.
        Returns:
        See above.
      • canLink

        public boolean canLink()
        Returns true if the object can be linked e.g. image add to dataset, by the user currently logged in, false otherwise, depending on permissions level.
        Returns:
        See above.
      • canDelete

        public boolean canDelete()
        Returns true if the object can be deleted by the user currently logged in, false otherwise, depending on permissions level.
        Returns:
        See above.
      • canChgrp

        public boolean canChgrp()
        Returns true if the object can be moved by the user currently logged in, false otherwise, depending on permissions level.
        Returns:
        See above.
      • canChown

        public boolean canChown()
        Returns true if the object can be given by the user currently logged in, false otherwise, depending on permissions level.
        Returns:
        See above.