Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Remove SelectableFieldValue from API #119

Closed
llorllale opened this issue Dec 30, 2017 · 0 comments · Fixed by #122
Closed

Remove SelectableFieldValue from API #119

llorllale opened this issue Dec 30, 2017 · 0 comments · Fixed by #122
Milestone

Comments

@llorllale
Copy link
Owner

Delete SelectableFieldValue and AssignedField#change() from the API because this flow
adds no real value. Users can just do issue.update().field(field, value); without the extra noise caused by filtering the stream from AssignedField#change().

Here's an example of what's done today (taken from DefaultAssignedFieldIT, which should be renamed to XmlAssignedFieldIT):

final XmlAssignedField field = (XmlAssignedField) issue.fields().stream().findFirst().get();
final FieldValue originalValue = field.value();
final FieldValue newValue = issue.project().fields().stream()
    .filter(f -> field.isSameField(f))
    .findAny().get()
    .values()
    .filter(v -> !v.isEqualTo(originalValue))
    .findAny().get();
final Issue updatedIssue = field.change()
    .filter(v -> v.isEqualTo(newValue))
    .findAny().get()
    .apply();

The final statement can easily be substituted for:

final Issue updatedIssue = issue.update(field, newValue);
@llorllale llorllale added this to the 1.0.0 milestone Dec 30, 2017
llorllale added a commit that referenced this issue Jan 2, 2018
(DEL) SelectableFieldValue, DefaultSelectableFieldValue,
      DefaultASsignedFieldIT (only had one test, on the #change()
      method)
(REF) AssignedField, XmlAssignedField, XmlAssignedFieldTest,
      MockAssignedField
llorllale added a commit that referenced this issue Jan 2, 2018
(#119) Remove SelectableFieldValue from API
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant