public class SwiftFormatUtils
extends java.lang.Object
Constructor and Description |
---|
SwiftFormatUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getBIC(BIC bic)
Gets the code from the parameter BIC.
|
static BIC |
getBIC(java.lang.String code) |
static java.lang.String |
getBoolean(java.lang.Boolean bool)
Parses a Boolean object into a string.
|
static java.lang.Boolean |
getBoolean(java.lang.String string)
Gets the given string as boolean.
|
static java.lang.String |
getCurrency(java.util.Currency currency)
Gets the currency code from the parameter Currency.
|
static java.util.Currency |
getCurrency(java.lang.String code) |
static java.lang.String |
getDate1(java.util.Calendar date)
Parses a Calendar object into a DATE1 string.
|
static java.util.Calendar |
getDate1(java.lang.String strDate)
Parses a DATE1 string (accept dates in format MMDD) into a Calendar object.
|
static java.lang.String |
getDate2(java.util.Calendar date)
Parses a Calendar object into a DATE2 string.
|
static java.util.Calendar |
getDate2(java.lang.String strDate)
Parses a DATE2 string (accept dates in format YYMMDD) into a Calendar object.
|
static java.lang.String |
getDate3(java.util.Calendar date)
Parses a Calendar object into a DATE1 string.
|
static java.util.Calendar |
getDate3(java.lang.String strDate)
Parses a DATE3 string (accept dates in format YYMM) into a Calendar object.
|
static java.lang.String |
getDate4(java.util.Calendar date)
Parses a Calendar object into a DATE1 string.
|
static java.util.Calendar |
getDate4(java.lang.String strDate)
Parses a DATE4 string (accept dates in format YYYYMMDD) into a Calendar object.
|
static java.lang.String |
getDateTime(java.util.Calendar date)
Parses a Calendar object into a string containing the DATETIME with YYYYMMDDHHMM format.
|
static java.util.Calendar |
getDateTime(java.lang.String strDate)
Parses a DATETIME string (accepts dates with time in YYYYMMDDHHMM format) into a Calendar object.
|
static java.lang.String |
getDateTimeShortYear(java.util.Calendar date)
Parses a Calendar object into a DATETIME with short year string in YYMMDDHHMM format.
|
static java.util.Calendar |
getDateTimeShortYear(java.lang.String strDate)
Parses a DATETIME with short year string (accepts dates with time in YYMMDDHHMM format) into a Calendar object.
|
static java.lang.String |
getDayTime(java.util.Calendar date)
Parses a Calendar object into a string containing the DAYTIME in DDHHMM format.
|
static java.util.Calendar |
getDayTime(java.lang.String strDate)
Parses a DAYTIME string (accepts dates with time in DDHHMM format) into a Calendar object.
|
static java.util.Calendar |
getHhmm(java.lang.String hhmm) |
static java.lang.String |
getHour(java.util.Calendar date)
Parses a Calendar object into a string containing the HOUR in HH format.
|
static java.util.Calendar |
getHour(java.lang.String strDate)
Parses an HOUR string (accepts time in HH format) into a Calendar object.
|
static java.lang.String |
getMIR(MIR mir)
Parses a MIR object into a string containing its serialized data.
|
static MIR |
getMIR(java.lang.String value)
Parses a string value into a MIR object.
|
static java.lang.String |
getMonthDay(java.util.Calendar date)
Parses a Calendar object into a string containing MONTHDAY in MMDD format.
|
static java.util.Calendar |
getMonthDay(java.lang.String strDate)
Parses a MONTHDAY string (accepts dates in MMDD format) into a Calendar object.
|
static java.lang.String |
getMOR(MOR mor)
Parses a MOR object into a string containing its serialized data.
|
static MOR |
getMOR(java.lang.String value)
Parses a string value into a MOR object.
|
static java.lang.String |
getNumber(java.lang.Number number)
Parses a Number into a SWIFT string number ####,## where trunked zero decimals and mandatory decimal separator.
|
static java.lang.Number |
getNumber(java.lang.String amount)
Parses a value into a java Number (BigDecimal) using the comma for decimal separator.
|
static java.lang.String |
getOffset(java.util.Calendar date)
Parses a Calendar object into a offset string.
|
static java.util.Calendar |
getOffset(java.lang.String string) |
static java.lang.Character |
getSign(java.lang.String string) |
static java.lang.String |
getTime2(java.util.Calendar date)
Parses a Calendar object into a TIME2 string.
|
static java.util.Calendar |
getTime2(java.lang.String hhmmss) |
static java.lang.String |
getTime3(java.util.Calendar date)
Parses a Calendar object into a TIME3 string.
|
static java.util.Calendar |
getTime3(java.lang.String hhmmss) |
static java.lang.String |
getYear(java.util.Calendar date)
Parses a Calendar object into a YYYY string.
|
static java.util.Calendar |
getYear(java.lang.String strDate)
Parses a YEAR string (accept dates in format YYYY) into a Calendar object.
|
public static java.lang.String getBIC(BIC bic)
bic
- BIC to usepublic static BIC getBIC(java.lang.String code)
code
- string with a BIC codepublic static java.lang.String getBoolean(java.lang.Boolean bool)
bool
- Boolean to parsenull
if the boolean object is nullpublic static java.lang.Boolean getBoolean(java.lang.String string)
string
- code to use where the expected values are "Y" or "N"null
otherwisepublic static java.lang.String getCurrency(java.util.Currency currency)
currency
- Currency to usepublic static java.util.Currency getCurrency(java.lang.String code)
code
- string with a currency codepublic static java.lang.String getDate1(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getDate1(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date formatpublic static java.lang.String getDate2(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getDate2(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date formatpublic static java.lang.String getDate3(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getDate3(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date formatpublic static java.lang.String getDate4(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getDate4(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date formatpublic static java.lang.String getDateTime(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getDateTime(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date formatpublic static java.lang.String getDateTimeShortYear(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getDateTimeShortYear(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date formatpublic static java.lang.String getDayTime(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getDayTime(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date formatpublic static java.util.Calendar getHhmm(java.lang.String hhmm)
hhmm
- hour and minutespublic static java.lang.String getHour(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getHour(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date formatpublic static java.lang.String getMIR(MIR mir)
mir
- MIR to processnull
if the parameter is empty or null
MIR.getMIR()
public static MIR getMIR(java.lang.String value)
value
- string containing the complete MIR valuenull
if the argument is not a 28 length string with a proper MIR dataMIR
public static java.lang.String getMonthDay(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getMonthDay(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date formatpublic static java.lang.String getMOR(MOR mor)
mor
- MOR to processnull
if the parameter is empty or null
MOR.getMOR()
public static MOR getMOR(java.lang.String value)
value
- string containing the complete MOR valuenull
if the argument is not a 28 length string with a proper MOR dataMOR
public static java.lang.String getNumber(java.lang.Number number)
number
- to parsenull
if the number is nullpublic static java.lang.Number getNumber(java.lang.String amount)
amount
- to parsenull
if the number could not be parsedpublic static java.lang.String getOffset(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getOffset(java.lang.String string)
string
- with an offsetpublic static java.lang.Character getSign(java.lang.String string)
string
- with a single characterpublic static java.lang.String getTime2(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getTime2(java.lang.String hhmmss)
hhmmss
- hour, minutes and secondspublic static java.lang.String getTime3(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getTime3(java.lang.String hhmmss)
hhmmss
- hour, minutes and secondspublic static java.lang.String getYear(java.util.Calendar date)
date
- Calendar to parsenull
if the calendar is nullpublic static java.util.Calendar getYear(java.lang.String strDate)
strDate
- string to parsenull
if the argument did not matched the expected date format