Skip to content

Commit

Permalink
[improve] mutable holder.
Browse files Browse the repository at this point in the history
  • Loading branch information
zolyfarkas committed Nov 5, 2023
1 parent 568ba2e commit 49f308d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spf4j-core/src/main/java/org/spf4j/base/MutableHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ public class MutableHolder<T> implements Supplier<T> {
public MutableHolder(final T value) {
this.value = value;
}

/**
* @deprecated use MutableHolder.of
* @deprecated use MutableHolder.empty
*/
@Deprecated
public MutableHolder() {
Expand All @@ -61,6 +60,10 @@ public static <T> MutableHolder<T> of(final T value) {
return (MutableHolder<T>) new MutableHolder<>(value);
}

public static <T> MutableHolder<T> empty() {
return (MutableHolder<T>) new MutableHolder<>();
}

public static <T extends Comparable> ComparableHolder<T> of(final T value) {
return ComparableHolder.of(value);
}
Expand Down

0 comments on commit 49f308d

Please sign in to comment.