de.hs_rm.cs.lecturenotes.shared.policy
Class FieldVerifierUtil

java.lang.Object
  extended by de.hs_rm.cs.lecturenotes.shared.policy.FieldVerifierUtil

public final class FieldVerifierUtil
extends java.lang.Object

Common methods for field verification purpose.

Version:
$LastChangedRevision: 241 $
Author:
Enrico Homann

Method Summary
static java.lang.String checkValidityAtLeastChars(java.lang.String attributeName, java.lang.String sValue, int nMinLength)
          Will check for validity of an attribute that needs to be a String and have at least a specific number of chars.
static java.lang.String checkValidityAtLeastNumber(java.lang.String attributeName, java.lang.Long nValue, long nMin)
          Will check for validity of an attribute that needs to be a Long and have to be at least a specific number.
static java.lang.String checkValidityEmail(java.lang.String attributeName, java.lang.String sValue)
          Will check for validity of an attribute that needs to be a String and in the email address format.
static java.lang.String checkValidityInterval(java.lang.String attributeName, java.lang.String sValue, int nMinLength, int nMaxLength)
          Will check for validity of an attribute that needs to be a String and have at least a specific number of chars and a maximum number of chars.
static java.lang.String checkValidityPositiveNumber(java.lang.String attributeName, long value)
          Will check for validity of an attribute that needs to have an positive number.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkValidityPositiveNumber

public static java.lang.String checkValidityPositiveNumber(java.lang.String attributeName,
                                                           long value)
Will check for validity of an attribute that needs to have an positive number. Returns a error message if invalid or null if value is valid.

Parameters:
attributeName - String
value - id
Returns:
String

checkValidityAtLeastChars

public static java.lang.String checkValidityAtLeastChars(java.lang.String attributeName,
                                                         java.lang.String sValue,
                                                         int nMinLength)
Will check for validity of an attribute that needs to be a String and have at least a specific number of chars. Returns a error message if invalid or null if value is valid.

Parameters:
attributeName - String
sValue - String
nMinLength - int
Returns:
String

checkValidityAtLeastNumber

public static java.lang.String checkValidityAtLeastNumber(java.lang.String attributeName,
                                                          java.lang.Long nValue,
                                                          long nMin)
Will check for validity of an attribute that needs to be a Long and have to be at least a specific number. Returns a error message if invalid or null if value is valid.

Parameters:
attributeName - String
nValue - Long
nMin - long
Returns:
String

checkValidityInterval

public static java.lang.String checkValidityInterval(java.lang.String attributeName,
                                                     java.lang.String sValue,
                                                     int nMinLength,
                                                     int nMaxLength)
Will check for validity of an attribute that needs to be a String and have at least a specific number of chars and a maximum number of chars. Returns a error message if invalid or null if value is valid.

Parameters:
attributeName - String
sValue - String
nMinLength - int
nMaxLength - int
Returns:
String

checkValidityEmail

public static java.lang.String checkValidityEmail(java.lang.String attributeName,
                                                  java.lang.String sValue)
Will check for validity of an attribute that needs to be a String and in the email address format. Returns a error message if invalid or null if value is valid.

Parameters:
attributeName - String
sValue - String
Returns:
String