Skip to content

Commit

Permalink
Improve JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
LoayGhreeb committed Jul 27, 2024
1 parent 0eb2ece commit 9e5bdd5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/com/tobiasdiez/easybind/EasyBind.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ public static <T> EasyObservableList<T> concat(ObservableList<? extends T>... so
/**
* Creates a new list in which each element is converted using the provided mapping.
* All changes to the underlying list are propagated to the converted list.
* <p>
* If the change event indicates that an item was updated, as determined by {@link ListChangeListener.Change#wasUpdated()},
* the mapping function is called again to create a new object reflecting the updated value.
* the mapping function is called to create a new object reflecting the updated value.
* <p>
* In contrast to {@link #map(ObservableList, Function)},
* the items are converted when they are inserted instead of when they are accessed.
Expand All @@ -319,7 +320,12 @@ public static <A, B> EasyObservableList<B> mapBacked(ObservableList<A> source, F
}

/**
* Similar to {@link #mapBacked(ObservableList, Function)}, but allows specifying if the mapping should be done on update.
* Similar to {@link #mapBacked(ObservableList, Function)}, but allows specifying if new objects should be created on update.
* <p>
* If {@code mapOnUpdate} is {@code true}, new objects are created when items in the source list are updated.
* <p>
* If {@code mapOnUpdate} is {@code false}, updates do not create new objects. This can be useful in scenarios where
* the mapped objects already have bindings or listeners that reflect changes from the source objects.
*/
public static <A, B> EasyObservableList<B> mapBacked(ObservableList<A> source, Function<A, B> mapper, boolean mapOnUpdate) {
return new MappedBackedList<>(source, mapper, mapOnUpdate);
Expand Down

0 comments on commit 9e5bdd5

Please sign in to comment.