Skip to content

Commit

Permalink
Make value from cache constructors public
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksander Mielczarek committed Jul 19, 2017
1 parent 3dfdd0e commit d54f5cb
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
*/
public final class CompletableFromCache extends ValueFromCache<Completable> {

CompletableFromCache(@Nullable Completable valueFromCache) {
public CompletableFromCache() {
this(null);
}

public CompletableFromCache(@Nullable Completable valueFromCache) {
super(valueFromCache);
}

public static CompletableFromCache empty() {
return new CompletableFromCache(null);
return new CompletableFromCache();
}

public static CompletableFromCache of(@Nullable Completable valueFromCache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
*/
public final class ObservableFromCache<T> extends ValueFromCache<Observable<T>> {

ObservableFromCache(@Nullable Observable<T> valueFromCache) {
public ObservableFromCache() {
this(null);
}

public ObservableFromCache(@Nullable Observable<T> valueFromCache) {
super(valueFromCache);
}

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

public static <T> ObservableFromCache<T> of(@Nullable Observable<T> valueFromCache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
*/
public final class SingleFromCache<T> extends ValueFromCache<Single<T>> {

SingleFromCache(@Nullable Single<T> valueFromCache) {
public SingleFromCache() {
this(null);
}

public SingleFromCache(@Nullable Single<T> valueFromCache) {
super(valueFromCache);
}

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

public static <T> SingleFromCache<T> of(@Nullable Single<T> valueFromCache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@

public final class CompletableFromCache extends ValueFromCache<Completable> {

CompletableFromCache(@Nullable Completable valueFromCache) {
public CompletableFromCache() {
this(null);
}

public CompletableFromCache(@Nullable Completable valueFromCache) {
super(valueFromCache);
}

public static CompletableFromCache empty() {
return new CompletableFromCache(null);
return new CompletableFromCache();
}

public static CompletableFromCache of(@Nullable Completable valueFromCache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@

public final class FlowableFromCache<T> extends ValueFromCache<Flowable<T>> {

FlowableFromCache(@Nullable Flowable<T> valueFromCache) {
public FlowableFromCache() {
this(null);
}

public FlowableFromCache(@Nullable Flowable<T> valueFromCache) {
super(valueFromCache);
}

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

public static <T> FlowableFromCache<T> of(@Nullable Flowable<T> valueFromCache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@

public final class MaybeFromCache<T> extends ValueFromCache<Maybe<T>> {

MaybeFromCache(@Nullable Maybe<T> valueFromCache) {
public MaybeFromCache() {
this(null);
}

public MaybeFromCache(@Nullable Maybe<T> valueFromCache) {
super(valueFromCache);
}

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

public static <T> MaybeFromCache<T> of(@Nullable Maybe<T> valueFromCache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@

public final class ObservableFromCache<T> extends ValueFromCache<Observable<T>> {

ObservableFromCache(@Nullable Observable<T> valueFromCache) {
public ObservableFromCache() {
this(null);
}

public ObservableFromCache(@Nullable Observable<T> valueFromCache) {
super(valueFromCache);
}

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

public static <T> ObservableFromCache<T> of(@Nullable Observable<T> valueFromCache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@

public final class SingleFromCache<T> extends ValueFromCache<Single<T>> {

SingleFromCache(@Nullable Single<T> valueFromCache) {
public SingleFromCache() {
this(null);
}

public SingleFromCache(@Nullable Single<T> valueFromCache) {
super(valueFromCache);
}

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

public static <T> SingleFromCache<T> of(@Nullable Single<T> valueFromCache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public abstract class ValueFromCache<T> {
@Nullable
private final T valueFromCache;

protected ValueFromCache(@Nullable T valueFromCache) {
public ValueFromCache(@Nullable T valueFromCache) {
this.valueFromCache = valueFromCache;
}

Expand Down

0 comments on commit d54f5cb

Please sign in to comment.