public class UserAction
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
UserAction.Type
Enum for indicating what type of action the user performed.
|
Constructor and Description |
---|
UserAction(UserAction.Type typeOfAction,
java.time.Instant timeOfAction) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static UserAction |
fromString(java.lang.String string)
Instantiates a
UserAction from a string that obeys the format used in toString() . |
java.time.Instant |
getTimestamp()
Get the time at which the user performed this action.
|
UserAction.Type |
getType()
Get the specific type of action performed by the user.
|
int |
hashCode() |
static void |
setTimestampFormatter(java.time.format.DateTimeFormatter formatter)
Sets the
DateTimeFormatter used when outputting a user action as a string and parsing a user action from
a string. |
java.lang.String |
toString() |
public UserAction(UserAction.Type typeOfAction, java.time.Instant timeOfAction)
public static void setTimestampFormatter(java.time.format.DateTimeFormatter formatter)
DateTimeFormatter
used when outputting a user action as a string and parsing a user action from
a string.formatter
- The formatter to use for outputting and parsing.public static UserAction fromString(java.lang.String string)
UserAction
from a string that obeys the format used in toString()
.string
- The string that represents a UserAction
UserAction
resulting from deserializing the string.public UserAction.Type getType()
public java.time.Instant getTimestamp()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object