public final class Utils
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.ThreadLocal<java.text.DecimalFormat> |
DECIMAL_FORMAT |
Dezimal-Format mit genau 2 Nachkommastellen
|
static double |
DOUBLE_TREAT_AS_EQUAL |
The difference below which doubles should be treated as equal numbers
|
static java.lang.String |
TEXT_JA |
Textual boolean true
|
static java.lang.String |
TEXT_NEIN |
Textual boolean false
|
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.String |
convertDoubleToString(java.lang.Double doubleValue) |
Formatiert einen Double-Wert in einen String mit genau 2
Nachkommastellen.
|
static java.math.BigDecimal |
convertStringToBigDecimal(java.lang.String doubleString) |
Remove EUR and tausend separator from given double string.
|
static java.lang.Double |
convertStringToDouble(java.lang.String doubleString) |
Remove EUR and tausend separator from given double string.
|
static java.time.LocalDate |
dateToLocalDate(java.util.Date date) |
Converts a
Date into a LocalDate based on the default
ZoneId |
static boolean |
getBooleanFromYesNoString(java.lang.String yesNo) |
Returns "
true" in case the String is "JA",
"false" else. |
static java.lang.Class<?>[] |
getClasses(java.lang.String packageName) |
Scans all classes accessible from the context class loader which belong
to the given package and sub packages.
|
static de.willuhn.jameica.hbci.rmi.Konto |
getKonto(java.lang.String ktoId) |
Liefert ein Konto zu den angegeben ID.
|
static java.util.Date |
getLastUmsatzDate(de.willuhn.jameica.hbci.rmi.Konto konto,
java.util.Calendar startDate) |
Liefert das Datum, ab wann die Umsätze geladen werden sollen.
|
static java.lang.String |
getYesNoStringFromBoolean(boolean yesNo) |
Returns the String object "JA" or "NEIN" depending on the given boolean
value.
|
static java.lang.String |
ibanFormater(java.lang.String iban) |
Fügt einer IBAN ein Leerzeichen an jeder 4 Stelle hinzu.
|
static void |
loadUmsatz(de.willuhn.jameica.hbci.rmi.Umsatz umsatz,
java.lang.String umsatzString) |
Läd einen Umsatz-Beschreibungstext in einen Umsatz.
|
static java.util.Date |
localDateToDate(java.time.LocalDate localDate) |
Converts a
LocalDate into a Date based on the default
ZoneId |
static java.lang.String |
maskCardNummer(java.lang.String kartenNummer) |
Maskiert eine Karten-Nummer und zeigt nur die letzten 4 Ziffern
|
static void |
notifyUsers(java.lang.String message) |
Display a message to the users.
|
static java.util.Date |
nowMinusDays(int days) |
Returns the
Date with the given offset in the past |
static java.util.Date |
parseOrNull(java.text.DateFormat dateFormatter,
java.lang.String value) |
Parse a date string with the given parser and either return the parsed
date or NULL.
|
static java.lang.String |
removeEOL(java.lang.String line) |
Entfernt einen Zeilenumbruch am Ende einer Zeile.
|
static void |
removePdfMeta(de.willuhn.jameica.hbci.rmi.Konto account) |
Removes deprecated Kontoauszugs-PDF META information from an account.
|
static java.lang.String |
replaceUmlauts(java.lang.String text) |
Ersetzt alle deutschen Umlaute mit den deutschen Entsprechungen.
|
static java.math.BigDecimal |
roundDoubleToBigDecimal(double number,
int digits) |
Rundet auf die angegebene Anzahl Nachkommastellen
|
static double |
roundNumber(double number,
int digits) |
Rundet auf die angegebene Anzahl Nachkommastellen
|
static void |
setProxyCfg(com.gargoylesoftware.htmlunit.WebClient webClient,
java.lang.String url) |
Setzt die Proxy-Einstellungen
|
static void |
waitIgnoreThreadInterrupts(long millis) |
Waits for the given but doesn't handle a InterruptedException.
|
public static final double DOUBLE_TREAT_AS_EQUAL
public static final java.lang.ThreadLocal<java.text.DecimalFormat> DECIMAL_FORMAT
public static final java.lang.String TEXT_JA
public static final java.lang.String TEXT_NEIN
public static java.lang.String convertDoubleToString(java.lang.Double doubleValue)
doubleValue - der Double-Wert der Konvertiert werden soll.public static java.math.BigDecimal convertStringToBigDecimal(java.lang.String doubleString)
doubleString - der String der Konvertiert werden sollpublic static java.lang.Double convertStringToDouble(java.lang.String doubleString)
doubleString - der String der Konvertiert werden sollpublic static java.time.LocalDate dateToLocalDate(java.util.Date date)
Date into a LocalDate based on the default
ZoneIddate - the Date to convertLocalDatepublic static boolean getBooleanFromYesNoString(java.lang.String yesNo)
true" in case the String is "JA",
"false" else.yesNo - the String to analysetrue" in case the String is "JA",
"false" else.public static java.lang.Class<?>[] getClasses(java.lang.String packageName)
throws java.io.IOException
packageName - The base packagejava.io.IOExceptionpublic static de.willuhn.jameica.hbci.rmi.Konto getKonto(java.lang.String ktoId)
ktoId - die Konto-ID.public static java.util.Date getLastUmsatzDate(de.willuhn.jameica.hbci.rmi.Konto konto,
java.util.Calendar startDate)
konto - das KontostartDate - das StartDatum als Calendar-Objektpublic static java.lang.String getYesNoStringFromBoolean(boolean yesNo)
yesNo - boolean value to convertbooleanpublic static java.lang.String ibanFormater(java.lang.String iban)
iban - IBAN mit oder ohne Leerzeichenpublic static void loadUmsatz(de.willuhn.jameica.hbci.rmi.Umsatz umsatz,
java.lang.String umsatzString)
throws java.rmi.RemoteException
umsatz - das Hibicus Umsatz ObjektumsatzString - die Umsatzbeschreibungjava.rmi.RemoteExceptionpublic static java.util.Date localDateToDate(java.time.LocalDate localDate)
LocalDate into a Date based on the default
ZoneIdlocalDate - the LocalDate to convertDatepublic static java.lang.String maskCardNummer(java.lang.String kartenNummer)
kartenNummer - public static void notifyUsers(java.lang.String message)
message - the message to displayApplicationCallback.notifyUser(String)public static java.util.Date nowMinusDays(int days)
Date with the given offset in the pastdays - public static java.util.Date parseOrNull(java.text.DateFormat dateFormatter,
java.lang.String value)
dateFormatter - the formatter to usevalue - the date string to parseDate or nullpublic static java.lang.String removeEOL(java.lang.String line)
line - die Zeilepublic static void removePdfMeta(de.willuhn.jameica.hbci.rmi.Konto account)
account - The account from which the META data should be removedpublic static java.lang.String replaceUmlauts(java.lang.String text)
text - der original Textpublic static java.math.BigDecimal roundDoubleToBigDecimal(double number,
int digits)
number - die Zahldigits - die Anzahl an Nachkommastellenpublic static double roundNumber(double number,
int digits)
number - die Zahldigits - die Anzahl an Nachkommastellenpublic static void setProxyCfg(com.gargoylesoftware.htmlunit.WebClient webClient,
java.lang.String url)
webClient - der WebClienturl - die URL für den ein Proxy benötigt wirdpublic static void waitIgnoreThreadInterrupts(long millis)
millis -