Package models.common

Class Study


  • @Entity
    public class Study
    extends java.lang.Object
    DB entity of a study. Used for JSON marshalling and JPA persistance. This entity has all properties of a study but not the results of a study. The results of a study are stored in StudyResults and ComponentResult. A study consists of a list components and their model is Component. It can have several Batches. Default values, where necessary, are at the fields or in the constructor. For the GUI a different model (models.gui.StudyProperties) is used.
    • Constructor Detail

      • Study

        public Study()
    • Method Detail

      • setId

        public void setId​(java.lang.Long id)
      • getId

        public java.lang.Long getId()
      • setUuid

        public void setUuid​(java.lang.String uuid)
      • getUuid

        public java.lang.String getUuid()
      • setTitle

        public void setTitle​(java.lang.String title)
      • getTitle

        public java.lang.String getTitle()
      • setDescription

        public void setDescription​(java.lang.String description)
      • getDescription

        public java.lang.String getDescription()
      • getDescriptionHash

        public java.lang.String getDescriptionHash()
      • setDirName

        public void setDirName​(java.lang.String dirName)
      • getDirName

        public java.lang.String getDirName()
      • setComments

        public void setComments​(java.lang.String comments)
      • getComments

        public java.lang.String getComments()
      • setDate

        public void setDate​(java.sql.Timestamp timestamp)
      • getDate

        public java.sql.Timestamp getDate()
      • setLocked

        public void setLocked​(boolean locked)
      • isLocked

        public boolean isLocked()
      • isActive

        public boolean isActive()
      • setActive

        public void setActive​(boolean active)
      • isGroupStudy

        public boolean isGroupStudy()
      • setGroupStudy

        public void setGroupStudy​(boolean groupStudy)
      • isLinearStudy

        public boolean isLinearStudy()
      • setLinearStudy

        public void setLinearStudy​(boolean linearStudy)
      • isAllowPreview

        public boolean isAllowPreview()
      • setAllowPreview

        public void setAllowPreview​(boolean allowPreview)
      • getStudyInput

        public java.lang.String getStudyInput()
      • setStudyInput

        public void setStudyInput​(java.lang.String studyInput)
      • getEndRedirectUrl

        public java.lang.String getEndRedirectUrl()
      • setEndRedirectUrl

        public void setEndRedirectUrl​(java.lang.String endRedirectUrl)
      • getStudyEntryMsg

        public java.lang.String getStudyEntryMsg()
      • setStudyEntryMsg

        public void setStudyEntryMsg​(java.lang.String studyEntryMsg)
      • getUserList

        public java.util.Set<User> getUserList()
      • addUser

        public void addUser​(User user)
        Adds a user to this study and the study to the user. Because Study is the owning side of the relationship, both updates are handled here to have one source of truth.
      • addAllUsers

        public void addAllUsers​(java.util.List<User> userList)
      • removeUser

        public void removeUser​(User user)
        Removes a user from this study and the study from the user. Because Study is the owning side of the relationship, both updates are handled here to have one source of truth.
      • removeAllUsers

        public void removeAllUsers​(java.util.List<User> userList)
      • hasUser

        public boolean hasUser​(User user)
      • getComponentList

        public java.util.List<Component> getComponentList()
      • getComponent

        public Component getComponent​(int position)
        Gets the component of this study at the given position. The smallest position is 1 (and not 0 as in an array).
      • getComponentPosition

        public java.lang.Integer getComponentPosition​(Component component)
        Returns the position (index+1) of the component in the list of components of this study or null if it doesn't exist.
      • addComponent

        public void addComponent​(Component component)
      • removeComponent

        public void removeComponent​(Component component)
      • hasComponent

        public boolean hasComponent​(Component component)
      • getFirstComponent

        public java.util.Optional<Component> getFirstComponent()
      • getLastComponent

        public java.util.Optional<Component> getLastComponent()
      • getNextComponent

        public java.util.Optional<Component> getNextComponent​(Component component)
      • getBatchList

        public java.util.List<Batch> getBatchList()
      • addBatch

        public void addBatch​(Batch batch)
        Adds a batch to this study and the study to the batch. Because Study is the owning side of the relationship, both updates are handled here to have one source of truth.
      • removeBatch

        public void removeBatch​(Batch batch)
        Removes a batch from this study and the study from the batch. Because Study is the owning side of the relationship, both updates are handled here to have one source of truth.
      • getDefaultBatch

        public Batch getDefaultBatch()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object