Skip to content

Commit

Permalink
parseBoolean instead of valueOf
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed May 5, 2024
1 parent 0d00395 commit d323739
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/amihaiemil/eoyaml/YamlMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -488,15 +488,15 @@ default boolean bool(final String key) {
* It is equivalent to:
* <pre>
* YamlMapping map = ...;
* boolean value = Boolean.valueOf(map.string(...));
* boolean value = Boolean.parseBoolean(map.string(...));
* </pre>
* @param key The key of the value.
* @return Boolean.
*/
default boolean bool(final YamlNode key) {
final YamlNode value = this.value(key);
if(value instanceof Scalar) {
return Boolean.valueOf(((Scalar) value).value());
return Boolean.parseBoolean(((Scalar) value).value());
}
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/amihaiemil/eoyaml/YamlSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ default LocalDateTime dateTime(final int index) {
* ignoring case, to the string "true".It is equivalent to:
* <pre>
* YamlSequence sequence = ...;
* boolean value = Boolean.valueOf(sequence.string(...));
* boolean value = Boolean.parseBoolean(sequence.string(...));
* </pre>
* @param index The index of the value.
* @return Boolean.
*/
default boolean bool(final int index) {
return Boolean.valueOf(this.string(index));
return Boolean.parseBoolean(this.string(index));
}

/**
Expand Down

0 comments on commit d323739

Please sign in to comment.