public class DateFormatCode extends CodeValidation
Modifier and Type | Field and Description |
---|---|
static String |
YYYYMM |
static String |
YYYYMMDD |
static String |
YYYYWW |
Constructor and Description |
---|
DateFormatCode() |
Modifier and Type | Method and Description |
---|---|
Date |
convertToDate(String d, String format) |
String |
convertToString(Date d, String format) |
static SimpleDateFormat |
getDateFormat(String format) |
boolean |
isValid(String format)
Checks if a specific code is valid.
|
check, isLowercase, isNumeric, isUppercase
public static final String YYYYMMDD
public static final String YYYYMM
public static final String YYYYWW
public boolean isValid(String format)
CodeValidation
isValid
in class CodeValidation
format
- the value you want to check
public String convertToString(Date d, String format) throws InvalidCodeException
InvalidCodeException
public Date convertToDate(String d, String format) throws InvalidCodeException, ParseException
InvalidCodeException
ParseException
public static SimpleDateFormat getDateFormat(String format) throws InvalidCodeException
InvalidCodeException
Copyright © 1998–2022. All rights reserved.