From: Marco Zanon Date: Sun, 12 Nov 2023 11:02:16 +0000 (+0000) Subject: Renamed some static methods. X-Git-Tag: SVN-to-Git~20 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=0cfbf0d9edeba7a518545041575235734bb7d9f9;p=Macaco Renamed some static methods. --- diff --git a/9.x/src/main/java/com/marcozanon/macaco/conversion/MDateConverter.java b/9.x/src/main/java/com/marcozanon/macaco/conversion/MDateConverter.java index 87b55a1..6c9894a 100644 --- a/9.x/src/main/java/com/marcozanon/macaco/conversion/MDateConverter.java +++ b/9.x/src/main/java/com/marcozanon/macaco/conversion/MDateConverter.java @@ -137,7 +137,7 @@ public class MDateConverter extends MObject { } } - protected static Date getDateFromStringByParameters(String x, String inputDateFormat, Locale inputLocale, TimeZone inputTimeZone) throws MInvalidConversionFormatException { + protected static Date createDateFromString(String x, String inputDateFormat, Locale inputLocale, TimeZone inputTimeZone) throws MInvalidConversionFormatException { if (MText.isBlank(x)) { throw new IllegalArgumentException("Invalid 'x': null or empty."); } @@ -180,7 +180,7 @@ public class MDateConverter extends MObject { return d2; } - protected static String getStringFromDateByParameters(Date date, String outputDateFormat, Locale outputLocale, TimeZone outputTimeZone) { + protected static String createStringFromDate(Date date, String outputDateFormat, Locale outputLocale, TimeZone outputTimeZone) { if (null == date) { throw new IllegalArgumentException("Invalid 'date': null."); } @@ -198,11 +198,11 @@ public class MDateConverter extends MObject { return sdf.format(date); } - public Date getDateFromString(String x) throws MInvalidConversionFormatException { + public Date createDateFromString(String x) throws MInvalidConversionFormatException { Date y = null; for (String dateFormat: this.getDateFormats()) { try { - y = MDateConverter.getDateFromStringByParameters(x, dateFormat, this.getLocale(), this.getTimeZone()); + y = MDateConverter.createDateFromString(x, dateFormat, this.getLocale(), this.getTimeZone()); // return y; } @@ -216,8 +216,8 @@ public class MDateConverter extends MObject { return y; // necessary to avoid Java compilation errors } - public String getStringFromDate(Date x) { - return MDateConverter.getStringFromDateByParameters(x, this.getDefaultDateFormat(), this.getLocale(), this.getTimeZone()); + public String createStringFromDate(Date x) { + return MDateConverter.createStringFromDate(x, this.getDefaultDateFormat(), this.getLocale(), this.getTimeZone()); } /* Helpers. */ diff --git a/9.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateConverter.java b/9.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateConverter.java index a9b7e4f..78daf32 100644 --- a/9.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateConverter.java +++ b/9.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateConverter.java @@ -114,7 +114,7 @@ public class MLocalDateConverter extends MObject { } } - protected static LocalDate getDateFromStringByParameters(String x, String inputDateFormat, Locale inputLocale) throws MInvalidConversionFormatException { + protected static LocalDate createDateFromString(String x, String inputDateFormat, Locale inputLocale) throws MInvalidConversionFormatException { if (MText.isBlank(x)) { throw new IllegalArgumentException("Invalid 'x': null or empty."); } @@ -134,7 +134,7 @@ public class MLocalDateConverter extends MObject { return d; } - protected static String getStringFromDateByParameters(LocalDate date, String outputDateFormat, Locale outputLocale) { + protected static String createStringFromDate(LocalDate date, String outputDateFormat, Locale outputLocale) { if (null == date) { throw new IllegalArgumentException("Invalid 'date': null."); } @@ -146,11 +146,11 @@ public class MLocalDateConverter extends MObject { return date.format(DateTimeFormatter.ofPattern(outputDateFormat, outputLocale).withResolverStyle(ResolverStyle.STRICT)); } - public LocalDate getDateFromString(String x) throws MInvalidConversionFormatException { + public LocalDate createDateFromString(String x) throws MInvalidConversionFormatException { LocalDate y = null; for (String dateFormat: this.getDateFormats()) { try { - y = MLocalDateConverter.getDateFromStringByParameters(x, dateFormat, this.getLocale()); + y = MLocalDateConverter.createDateFromString(x, dateFormat, this.getLocale()); // return y; } @@ -164,8 +164,8 @@ public class MLocalDateConverter extends MObject { return y; // necessary to avoid Java compilation errors } - public String getStringFromDate(LocalDate x) { - return MLocalDateConverter.getStringFromDateByParameters(x, this.getDefaultDateFormat(), this.getLocale()); + public String createStringFromDate(LocalDate x) { + return MLocalDateConverter.createStringFromDate(x, this.getDefaultDateFormat(), this.getLocale()); } } diff --git a/9.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateTimeConverter.java b/9.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateTimeConverter.java index 85b5d43..7de5d71 100644 --- a/9.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateTimeConverter.java +++ b/9.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateTimeConverter.java @@ -114,7 +114,7 @@ public class MLocalDateTimeConverter extends MObject { } } - protected static LocalDateTime getDatetimeFromStringByParameters(String x, String inputDatetimeFormat, Locale inputLocale) throws MInvalidConversionFormatException { + protected static LocalDateTime createDatetimeFromString(String x, String inputDatetimeFormat, Locale inputLocale) throws MInvalidConversionFormatException { if (MText.isBlank(x)) { throw new IllegalArgumentException("Invalid 'x': null or empty."); } @@ -134,7 +134,7 @@ public class MLocalDateTimeConverter extends MObject { return dt; } - protected static String getStringFromDatetimeByParameters(LocalDateTime datetime, String outputDatetimeFormat, Locale outputLocale) { + protected static String createStringFromDatetime(LocalDateTime datetime, String outputDatetimeFormat, Locale outputLocale) { if (null == datetime) { throw new IllegalArgumentException("Invalid 'datetime': null."); } @@ -146,11 +146,11 @@ public class MLocalDateTimeConverter extends MObject { return datetime.format(DateTimeFormatter.ofPattern(outputDatetimeFormat, outputLocale).withResolverStyle(ResolverStyle.STRICT)); } - public LocalDateTime getDatetimeFromString(String x) throws MInvalidConversionFormatException { + public LocalDateTime createDatetimeFromString(String x) throws MInvalidConversionFormatException { LocalDateTime y = null; for (String datetimeFormat: this.getDatetimeFormats()) { try { - y = MLocalDateTimeConverter.getDatetimeFromStringByParameters(x, datetimeFormat, this.getLocale()); + y = MLocalDateTimeConverter.createDatetimeFromString(x, datetimeFormat, this.getLocale()); // return y; } @@ -164,8 +164,8 @@ public class MLocalDateTimeConverter extends MObject { return y; // necessary to avoid Java compilation errors } - public String getStringFromDatetime(LocalDateTime x) { - return MLocalDateTimeConverter.getStringFromDatetimeByParameters(x, this.getDefaultDatetimeFormat(), this.getLocale()); + public String createStringFromDatetime(LocalDateTime x) { + return MLocalDateTimeConverter.createStringFromDatetime(x, this.getDefaultDatetimeFormat(), this.getLocale()); } } diff --git a/9.x/src/main/java/com/marcozanon/macaco/conversion/MNumberConverter.java b/9.x/src/main/java/com/marcozanon/macaco/conversion/MNumberConverter.java index ae192d8..1f885fe 100644 --- a/9.x/src/main/java/com/marcozanon/macaco/conversion/MNumberConverter.java +++ b/9.x/src/main/java/com/marcozanon/macaco/conversion/MNumberConverter.java @@ -115,7 +115,7 @@ public class MNumberConverter extends MObject { } } - protected static BigDecimal getNumberFromStringByParameters(String x, String inputNumberFormat, Locale inputLocale) throws MInvalidConversionFormatException { + protected static BigDecimal createNumberFromString(String x, String inputNumberFormat, Locale inputLocale) throws MInvalidConversionFormatException { if (MText.isBlank(x)) { throw new IllegalArgumentException("Invalid 'x': null or empty."); } @@ -137,7 +137,7 @@ public class MNumberConverter extends MObject { return bd; } - protected static String getStringFromNumberByParameters(BigDecimal number, String outputNumberFormat, Locale outputLocale) { + protected static String createStringFromNumber(BigDecimal number, String outputNumberFormat, Locale outputLocale) { if (null == number) { throw new IllegalArgumentException("Invalid 'number': null."); } @@ -153,11 +153,11 @@ public class MNumberConverter extends MObject { return df.format(number); } - public BigDecimal getNumberFromString(String x) throws MInvalidConversionFormatException { + public BigDecimal createNumberFromString(String x) throws MInvalidConversionFormatException { BigDecimal y = null; for (String numberFormat: this.getNumberFormats()) { try { - y = MNumberConverter.getNumberFromStringByParameters(x, numberFormat, this.getLocale()); + y = MNumberConverter.createNumberFromString(x, numberFormat, this.getLocale()); // return y; } @@ -171,8 +171,8 @@ public class MNumberConverter extends MObject { return y; // necessary to avoid Java compilation errors } - public String getStringFromNumber(BigDecimal x) { - return MNumberConverter.getStringFromNumberByParameters(x, this.getDefaultNumberFormat(), this.getLocale()); + public String createStringFromNumber(BigDecimal x) { + return MNumberConverter.createStringFromNumber(x, this.getDefaultNumberFormat(), this.getLocale()); } }