Skip to content

Commit

Permalink
Rename Options "remove" to "unset"
Browse files Browse the repository at this point in the history
  • Loading branch information
phillcunnington committed Sep 20, 2016
1 parent d118534 commit 160763e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cuppa/src/main/java/org/forgerock/cuppa/model/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ public <V, O extends Option<V>> Optional<V> get(Class<O> optionClass) {
}

/**
* Removes an option.
* Un-sets an option.
*
* @param optionClass The class of the option to remove.
* @param optionClass The class of the option to un-set.
* @param <O> The type of the option.
* @return A new Option instance without the specified option.
*/
public <O extends Option<?>> Options remove(Class<O> optionClass) {
public <O extends Option<?>> Options unset(Class<O> optionClass) {
Options copy = copyOf(this);
copy.options.remove(optionClass);
return copy;
Expand Down
2 changes: 1 addition & 1 deletion cuppa/src/test/java/org/forgerock/cuppa/OptionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void addingNewOptionShouldReturnNewOptionCopy() {
@Test
public void removingOptionShouldReturnNewOptionCopy() {
Options options = new Options().set(new TestOption());
Options optionsCopy = options.remove(TestOption.class);
Options optionsCopy = options.unset(TestOption.class);
assertThat(options.get(TestOption.class)).isNotEqualTo(Optional.empty());
assertThat(optionsCopy.get(TestOption.class)).isEqualTo(Optional.empty());
}
Expand Down

0 comments on commit 160763e

Please sign in to comment.