Package com.atlassian.crowd.model.token
Class TokenLifetime
java.lang.Object
com.atlassian.crowd.model.token.TokenLifetime
A value object that describes the requested lifetime of a new Token. Get an instance using the factory method, or use
the default lifetime constant.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TokenLifetime
Indicates that the token does not specify a concrete lifetime, and will use the default lifetime -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
int
hashCode()
static TokenLifetime
inSeconds
(long seconds) Builds a new instance that represents a requested lifetime of a given number of secondsboolean
-
Field Details
-
USE_DEFAULT
Indicates that the token does not specify a concrete lifetime, and will use the default lifetime
-
-
Method Details
-
getSeconds
public long getSeconds()- Returns:
- the token lifetime in seconds
- Throws:
IllegalStateException
- if this is the default lifetime, i.e., it does not prescribe a particular duration
-
isDefault
public boolean isDefault()- Returns:
- true if this is the default lifetime, i.e., it does not prescribe a particular duration
-
inSeconds
Builds a new instance that represents a requested lifetime of a given number of seconds- Parameters:
seconds
- requested token lifetime in seconds- Returns:
- a new instance of TokenLifetime
-
equals
-
hashCode
public int hashCode()
-