org.silverpeas.termsOfService.constant
Enum TermsOfServiceAcceptanceFrequency

java.lang.Object
  extended by java.lang.Enum<TermsOfServiceAcceptanceFrequency>
      extended by org.silverpeas.termsOfService.constant.TermsOfServiceAcceptanceFrequency
All Implemented Interfaces:
Serializable, Comparable<TermsOfServiceAcceptanceFrequency>

public enum TermsOfServiceAcceptanceFrequency
extends Enum<TermsOfServiceAcceptanceFrequency>

User: Yohann Chastagnier Date: 10/09/13


Enum Constant Summary
ALWAYS
           
DAILY
           
MONTHLY
           
NEVER
           
ONE
           
WEEKLY
           
YEARLY
           
 
Method Summary
static TermsOfServiceAcceptanceFrequency decode(String tosAcceptanceFrequency)
          Decode from a string value.
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 isAcceptanceDateExpired(Date tosAcceptanceDate, String locale)
          Indicates if the given acceptance date of terms of service is valid compared to the current 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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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 name
NullPointerException - 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:


Copyright © 2016 Silverpeas. All Rights Reserved.