Class UserActivity

java.lang.Object
io.goobi.viewer.model.security.user.UserActivity

public class UserActivity extends Object
Represents a single recorded activity of a user, such as creating a comment, bookmark, search, or annotation.

Each instance captures the activity type, a human-readable label, the timestamp, and whether it is an update to an existing item. Factory methods are provided for constructing instances from domain objects such as Comment or Search.

Author:
Florian Alpers
  • Field Details

  • Constructor Details

    • UserActivity

      public UserActivity(UserActivity.ActivityType type, String label, LocalDateTime date, boolean update)
      Parameters:
      type - type of user activity
      label - display label describing the activity
      date - date and time of the activity
      update - true if this represents an update to an existing item
  • Method Details

    • getFromComment

      public static UserActivity getFromComment(Comment comment)
    • getFromCommentUpdate

      public static UserActivity getFromCommentUpdate(Comment comment)
    • getFromCampaignAnnotation

      public static UserActivity getFromCampaignAnnotation(CrowdsourcingAnnotation anno)
    • getFromCampaignAnnotationUpdate

      public static UserActivity getFromCampaignAnnotationUpdate(CrowdsourcingAnnotation anno)
    • getFromBookmark

      public static UserActivity getFromBookmark(Bookmark bookmark)
    • getFromSearch

      public static UserActivity getFromSearch(Search search)
    • getType

      public UserActivity.ActivityType getType()
    • getLabel

      public String getLabel()
    • getDate

      public LocalDateTime getDate()
    • isUpdate

      public boolean isUpdate()
    • equals

      public boolean equals(Object obj)
      Equals if label and type are equal.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare to this user activity
      Returns:
      true if the given object is equal to this instance, false otherwise
    • hashCode

      public int hashCode()
      Builds from label and type.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this object