Class ObjectWrapper<T extends DataObject>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected T data
      Wrapped object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ObjectWrapper​(T o)
      Constructor of the class ObjectWrapper.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T asDataObject()
      Returns the wrapped DataObject.
      boolean canAnnotate()
      Returns true if the object can be annotated false otherwise, depending on permissions level.
      boolean canChgrp()
      Returns true if the object can be moved by the user currently logged in, false otherwise, depending on permissions level.
      boolean canChown()
      Returns true if the object can be given by the user currently logged in, false otherwise, depending on permissions level.
      boolean canDelete()
      Returns true if the object can be deleted by the user currently logged in, false otherwise, depending on permissions level.
      boolean canEdit()
      Returns true if the object can be edited by the user currently logged in false otherwise, depending on permissions level.
      boolean canLink()
      Returns true if the object can be linked e.g.
      java.sql.Timestamp getCreated()
      Gets the object creation date
      java.lang.Long getGroupId()
      Gets the group ID
      long getId()
      Gets the object id
      Experimenter getOwner()
      Gets the owner ID
      void saveAndUpdate​(DataManager dm)
      Saves and updates object.
      java.lang.String toString()
      Overridden to return the name of the class and the object id.
      static <U extends DataObject,​V extends RemoteObject>
      java.util.List<V>
      wrap​(java.util.Collection<U> objects, java.util.function.Function<? super U,​? extends V> mapper)
      Converts a DataObject list to a ObjectWrapper list, sorted by sorter.
      static <U extends DataObject,​V extends RemoteObject,​W extends java.lang.Comparable<W>>
      java.util.List<V>
      wrap​(java.util.Collection<U> objects, java.util.function.Function<? super U,​? extends V> mapper, java.util.function.Function<? super V,​? extends W> sorter)
      Converts a DataObject list to an ObjectWrapper list, sorted by sorter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • data

        protected T extends DataObject data
        Wrapped object
    • Constructor Detail

      • ObjectWrapper

        protected ObjectWrapper​(T o)
        Constructor of the class ObjectWrapper.
        Parameters:
        o - The DataObject to wrap in the ObjectWrapper.
    • Method Detail

      • wrap

        public static <U extends DataObject,​V extends RemoteObject,​W extends java.lang.Comparable<W>> java.util.List<V> wrap​(java.util.Collection<U> objects,
                                                                                                                                         java.util.function.Function<? super U,​? extends V> mapper,
                                                                                                                                         java.util.function.Function<? super V,​? extends W> sorter)
        Converts a DataObject list to an 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

        public static <U extends DataObject,​V extends RemoteObject> java.util.List<V> wrap​(java.util.Collection<U> objects,
                                                                                                 java.util.function.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.
      • getId

        public long getId()
        Gets the object id
        Specified by:
        getId in interface RemoteObject
        Returns:
        id.
      • getCreated

        public java.sql.Timestamp getCreated()
        Gets the object creation date
        Specified by:
        getCreated in interface RemoteObject
        Returns:
        creation date.
      • getGroupId

        public java.lang.Long getGroupId()
        Gets the group ID
        Specified by:
        getGroupId in interface RemoteObject
        Returns:
        group id.
      • toString

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

        public boolean canAnnotate()
        Returns true if the object can be annotated false otherwise, depending on permissions level.
        Specified by:
        canAnnotate in interface RemoteObject
        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.
        Specified by:
        canEdit in interface RemoteObject
        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.
        Specified by:
        canLink in interface RemoteObject
        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.
        Specified by:
        canDelete in interface RemoteObject
        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.
        Specified by:
        canChgrp in interface RemoteObject
        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.
        Specified by:
        canChown in interface RemoteObject
        Returns:
        See above.