Implemented the getSecondary*Formats() methods.
authorMarco Zanon <info@marcozanon.com>
Wed, 23 Mar 2022 13:22:00 +0000 (13:22 +0000)
committerMarco Zanon <info@marcozanon.com>
Wed, 23 Mar 2022 13:22:00 +0000 (13:22 +0000)
7.x/src/main/java/com/marcozanon/macaco/conversion/MDateConverter.java
7.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateConverter.java
7.x/src/main/java/com/marcozanon/macaco/conversion/MLocalDateTimeConverter.java
7.x/src/main/java/com/marcozanon/macaco/conversion/MNumberConverter.java

index 181da3bb665171f354d16ce597edbc24c07cd589..8151757b30d2882b96fb367e06edbca6996a063d 100644 (file)
@@ -86,6 +86,14 @@ public class MDateConverter extends MObject {
         return this.getDateFormats().iterator().next();
     }
 
+    public LinkedHashSet<String> getSecondaryDateFormats() {
+        LinkedHashSet<String> dateFormats = (LinkedHashSet<String>)this.getDateFormats().clone();
+        //
+        dateFormats.remove(this.getDefaultDateFormat());
+        //
+        return dateFormats;
+    }
+
     /* Locale. */
 
     protected void setLocale(Locale locale) {
index 85dd861084b87a27fda9c76fedf4588c63470a8c..ed946c6e81fe0bb0e5a9f977e2d53d4eec3d0b8b 100644 (file)
@@ -77,6 +77,14 @@ public class MLocalDateConverter extends MObject {
         return this.getDateFormats().iterator().next();
     }
 
+    public LinkedHashSet<String> getSecondaryDateFormats() {
+        LinkedHashSet<String> dateFormats = (LinkedHashSet<String>)this.getDateFormats().clone();
+        //
+        dateFormats.remove(this.getDefaultDateFormat());
+        //
+        return dateFormats;
+    }
+
     /* Locale. */
 
     protected void setLocale(Locale locale) {
index 67f0e94a3a6e1b1a664dfba1a5a8e9c752fb5bc1..233d5f15fc628bf479c8c1524d390a42fa5cf86a 100644 (file)
@@ -77,6 +77,14 @@ public class MLocalDateTimeConverter extends MObject {
         return this.getDatetimeFormats().iterator().next();
     }
 
+    public LinkedHashSet<String> getSecondaryDatetimeFormats() {
+        LinkedHashSet<String> datetimeFormats = (LinkedHashSet<String>)this.getDatetimeFormats().clone();
+        //
+        datetimeFormats.remove(this.getDefaultDatetimeFormat());
+        //
+        return datetimeFormats;
+    }
+
     /* Locale. */
 
     protected void setLocale(Locale locale) {
index 6f5d6564888873fa1ee4334b7ed7f318e7412c96..65cc3f8a8544079dd2e99afb004eff11946fd641 100644 (file)
@@ -78,6 +78,14 @@ public class MNumberConverter extends MObject {
         return this.getNumberFormats().iterator().next();
     }
 
+    public LinkedHashSet<String> getSecondaryNumberFormats() {
+        LinkedHashSet<String> numberFormats = (LinkedHashSet<String>)this.getNumberFormats().clone();
+        //
+        numberFormats.remove(this.getDefaultNumberFormat());
+        //
+        return numberFormats;
+    }
+
     /* Locale. */
 
     protected void setLocale(Locale locale) {