Skip to content

Commit

Permalink
added support for "t" or "T" to be boolean / atomicBoolean true
Browse files Browse the repository at this point in the history
  • Loading branch information
jdereg committed Jan 15, 2024
1 parent f4880fe commit 750959f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static AtomicBoolean toAtomicBoolean(Object from, Converter converter, Converter
if (str.isEmpty()) {
return new AtomicBoolean(false);
}
return new AtomicBoolean("true".equalsIgnoreCase(str));
return new AtomicBoolean("true".equalsIgnoreCase(str) || "t".equalsIgnoreCase(str));
}

static AtomicInteger toAtomicInteger(Object from, Converter converter, ConverterOptions options) {
Expand Down Expand Up @@ -195,7 +195,7 @@ static AtomicLong toAtomicLong(Object from, Converter converter, ConverterOption
return new AtomicLong(value);
}

public static Boolean toBoolean(Object from, Converter converter, ConverterOptions options) {
static Boolean toBoolean(Object from, Converter converter, ConverterOptions options) {
String str = ((String) from).trim();
if (str.isEmpty()) {
return false;
Expand All @@ -206,10 +206,10 @@ public static Boolean toBoolean(Object from, Converter converter, ConverterOptio
} else if ("false".equals(str)) {
return false;
}
return "true".equalsIgnoreCase(str);
return "true".equalsIgnoreCase(str) || "t".equalsIgnoreCase(str);
}

public static char toCharacter(Object from, Converter converter, ConverterOptions options) {
static char toCharacter(Object from, Converter converter, ConverterOptions options) {
String str = ((String) from);
if (str.isEmpty()) {
return (char) 0;
Expand Down

0 comments on commit 750959f

Please sign in to comment.