Skip to content

Commit

Permalink
Deprecated internal.Producers.immediate(Failed)Producer and redirect …
Browse files Browse the repository at this point in the history
…to the non-internal version instead.

RELNOTES=Deprecated `dagger.producers.internal.Producers.immediateProducer()` and `dagger.producers.internal.Producers.immediateFailedProducer()` in favor of newly added methods with the same names in  `dagger.producers.Producers`

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=228739276
  • Loading branch information
ronshapiro committed Jan 15, 2019
1 parent bf79cd3 commit a4914c6
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions java/dagger/producers/internal/Producers.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,26 @@ public ListenableFuture<T> get() {
};
}

/** Returns a producer that succeeds with the given value. */
public static <T> Producer<T> immediateProducer(final T value) {
final ListenableFuture<T> future = Futures.immediateFuture(value);
return new CompletedProducer<T>() {
@Override
public ListenableFuture<T> get() {
return future;
}
};
/**
* Returns a producer that succeeds with the given value.
*
* @deprecated Prefer the non-internal version of this method: {@link
* dagger.producers.Producers#immediateProducer(Object)}.
*/
@Deprecated
public static <T> Producer<T> immediateProducer(T value) {
return dagger.producers.Producers.immediateProducer(value);
}

/** Returns a producer that fails with the given exception. */
public static <T> Producer<T> immediateFailedProducer(final Throwable throwable) {
final ListenableFuture<T> future = Futures.immediateFailedFuture(throwable);
return new CompletedProducer<T>() {
@Override
public ListenableFuture<T> get() {
return future;
}
};
/**
* Returns a producer that fails with the given exception.
*
* @deprecated Prefer the non-internal version of this method: {@link
* dagger.producers.Producers#immediateFailedProducer(Throwable)}.
*/
@Deprecated
public static <T> Producer<T> immediateFailedProducer(Throwable throwable) {
return dagger.producers.Producers.immediateFailedProducer(throwable);
}

/**
Expand Down

0 comments on commit a4914c6

Please sign in to comment.