Enum TermsOfServiceAcceptanceFrequency
- java.lang.Object
-
- java.lang.Enum<TermsOfServiceAcceptanceFrequency>
-
- org.silverpeas.core.security.authentication.verifier.TermsOfServiceAcceptanceFrequency
-
- All Implemented Interfaces:
Serializable
,Comparable<TermsOfServiceAcceptanceFrequency>
public enum TermsOfServiceAcceptanceFrequency extends Enum<TermsOfServiceAcceptanceFrequency>
User: Yohann Chastagnier Date: 10/09/13
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TermsOfServiceAcceptanceFrequency
decode(String tosAcceptanceFrequency)
Decode from a string value.boolean
isAcceptanceDateExpired(Date tosAcceptanceDate, String locale)
Indicates if the given acceptance date of terms of service is valid compared to the current date.protected boolean
isAcceptanceDateExpired(Date referenceDate, Date tosAcceptanceDate, String locale)
Indicates if the given acceptance date of terms of service is valid compared to the reference date.boolean
isActivated()
Indicates if terms of service frequency is activated.static TermsOfServiceAcceptanceFrequency
valueOf(String name)
Returns the enum constant of this type with the specified name.static TermsOfServiceAcceptanceFrequency[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NEVER
public static final TermsOfServiceAcceptanceFrequency NEVER
-
ONE
public static final TermsOfServiceAcceptanceFrequency ONE
-
DAILY
public static final TermsOfServiceAcceptanceFrequency DAILY
-
WEEKLY
public static final TermsOfServiceAcceptanceFrequency WEEKLY
-
MONTHLY
public static final TermsOfServiceAcceptanceFrequency MONTHLY
-
YEARLY
public static final TermsOfServiceAcceptanceFrequency YEARLY
-
ALWAYS
public static final TermsOfServiceAcceptanceFrequency ALWAYS
-
-
Method Detail
-
values
public static TermsOfServiceAcceptanceFrequency[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TermsOfServiceAcceptanceFrequency c : TermsOfServiceAcceptanceFrequency.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TermsOfServiceAcceptanceFrequency valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isActivated
public boolean isActivated()
Indicates if terms of service frequency is activated.- Returns:
-
isAcceptanceDateExpired
public boolean isAcceptanceDateExpired(Date tosAcceptanceDate, String locale)
Indicates if the given acceptance date of terms of service is valid compared to the current date.- Parameters:
tosAcceptanceDate
-locale
-- Returns:
-
isAcceptanceDateExpired
protected boolean isAcceptanceDateExpired(Date referenceDate, Date tosAcceptanceDate, String locale)
Indicates if the given acceptance date of terms of service is valid compared to the reference date.- Parameters:
referenceDate
-tosAcceptanceDate
-locale
-- Returns:
-
decode
public static TermsOfServiceAcceptanceFrequency decode(String tosAcceptanceFrequency)
Decode from a string value. NEVER by default (even the given value is unknown).- Parameters:
tosAcceptanceFrequency
-- Returns:
-
-