public abstract class CodeValidation extends Object
Constructor and Description |
---|
CodeValidation() |
Modifier and Type | Method and Description |
---|---|
String |
check(String code)
Checks if a specific code is valid.
|
boolean |
isLowercase(String code, int chars)
Checks the length of a code and if a code consists of lowercase letters from a to z.
|
boolean |
isNumeric(String code, int digits)
Checks the length of a code and if a code consists of numbers only.
|
boolean |
isUppercase(String code, int chars)
Checks the length of a code and if a code consists of uppercase letters from A to Z.
|
abstract boolean |
isValid(String code)
Checks if a specific code is valid.
|
public abstract boolean isValid(String code)
code
- the value you want to check
public String check(String code) throws InvalidCodeException
code
- the value you want to check
InvalidCodeException
- reveals the reason why the code isn't valid
public boolean isNumeric(String code, int digits)
code
- the code that needs to be checked
digits
- the expected length of the code
public boolean isUppercase(String code, int chars)
code
- the code that needs to be checked
chars
- the expected length of the code
public boolean isLowercase(String code, int chars)
code
- the code that needs to be checked
chars
- the expected length of the code
Copyright © 1998–2024. All rights reserved.