Skip to content

Add method to KiwiJdbc to get string values with option to trim #1059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

sleberknight
Copy link
Member

Add stringOrNullIfBlank method to KiwiJdbc. If the value returned from the database is null or blank (whitespace only), this method returns null. If the value from the database is not blank, the string is returned after applying a StringTrimOption to it. This option can either preserve leading and trailing whitespace, or remove it. All intermediate whitespace (i.e. between words) is preserved.

Also added BlankStringSource, which is copied from kiwi-test in order to avoid a circular dependency between kiwi and kiwi-test.

Closes #1049

Add stringOrNullIfBlank method to KiwiJdbc. If the value returned
from the database is null or blank (whitespace only), this method
returns null. If the value from the database is not blank, the
string is returned after applying a StringTrimOption to it. This
option can either preserve leading and trailing whitespace, or
remove it. All intermediate whitespace (i.e. between words) is
preserved.

Also added BlankStringSource, which is copied from kiwi-test in
order to avoid a circular dependency between kiwi and kiwi-test.

Closes #1049
@sleberknight sleberknight self-assigned this Oct 8, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

91.7% 91.7% Coverage
0.0% 0.0% Duplication

@sleberknight sleberknight merged commit 1a05fc0 into master Oct 8, 2023
@sleberknight sleberknight deleted the 1049-add-string-retrieval-with-trim-option-method-in-KiwiJdbc branch October 8, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new KiwiJdbc utility to return optionally stripped string, or null if blank
1 participant