Skip to content

Commit 28bed58

Browse files
committed
added convenience method getBoolOrDefault
1 parent 3933ad7 commit 28bed58

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

quickfixj-core/src/main/java/quickfix/SessionSettings.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,14 @@ public boolean getBool(SessionID sessionID, String key) throws FieldConvertError
412412
}
413413

414414
/**
415-
* Get a settings boolean if present or use default value.
415+
* Get a boolean setting from the default section if present or use default value.
416+
*/
417+
public boolean getBoolOrDefault(String key, boolean defaultValue) throws FieldConvertError, ConfigError {
418+
return isSetting(key) ? getBool(key) : defaultValue;
419+
}
420+
421+
/**
422+
* Get a boolean setting if present or use default value.
416423
*/
417424
public boolean getBoolOrDefault(SessionID sessionID, String key, boolean defaultValue) throws FieldConvertError, ConfigError {
418425
return isSetting(sessionID, key) ? getBool(sessionID, key) : defaultValue;

0 commit comments

Comments
 (0)