Skip to content

Add optional getters to IniFile and PropertySet#2132

Merged
jodastephen merged 1 commit into
masterfrom
topic/ini
Feb 7, 2020
Merged

Add optional getters to IniFile and PropertySet#2132
jodastephen merged 1 commit into
masterfrom
topic/ini

Conversation

@jodastephen
Copy link
Copy Markdown
Contributor

Optional configuration turns out to be quite common


assertThat(test.isEmpty()).isEqualTo(true);
assertThat(test.contains("unknown")).isEqualTo(false);
assertThat(test.findValue("unknown")).isEmpty();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add this in test_of_multimap:

assertThatIllegalArgumentException().isThrownBy(() -> test.findValue("a"));

Integrate lists of properties with single properties without exceptions
@jodastephen jodastephen merged commit b2b0b96 into master Feb 7, 2020
@delete-merged-branch delete-merged-branch Bot deleted the topic/ini branch February 7, 2020 17:22
@ashleyheath
Copy link
Copy Markdown
Contributor

If a key has multiple values, the values will be returned as a comma separated list.

Isn't this exactly what public ImmutableList<String> valueList(String key) is for? Concatenating the values seems like it'll introduce more bugs than it'll fix...

@jodastephen
Copy link
Copy Markdown
Contributor Author

Having methods like asMap() throw an exception was causing issues anyway.

@jodastephen jodastephen added this to the v2.7 milestone Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants