public class

IncreasingQualityDataSourceSupplier

extends Object
implements Supplier<T>
java.lang.Object
   ↳ com.facebook.datasource.IncreasingQualityDataSourceSupplier<T>

Class Overview

DataSource supplier that provides a data source which forwards results of the underlying data sources with the increasing quality.

Data sources are obtained in order. The first data source in array is considered to be of the highest quality. The first data source to provide an result gets forwarded until one of the higher quality data sources provides its final image at which point that data source gets forwarded (and so on). That being said, only the first data source to provide an result is streamed.

Outcome (success/failure) of the data source provided by this supplier is determined by the outcome of the highest quality data source (the first data source in the array).

Summary

Public Methods
static <T> IncreasingQualityDataSourceSupplier<T> create(List<Supplier<DataSource<T>>> dataSourceSuppliers)
Creates a new data source supplier with increasing-quality strategy.
boolean equals(Object other)
DataSource<T> get()
Retrieves an instance of the appropriate type.
int hashCode()
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.common.internal.Supplier

Public Methods

public static IncreasingQualityDataSourceSupplier<T> create (List<Supplier<DataSource<T>>> dataSourceSuppliers)

Creates a new data source supplier with increasing-quality strategy.

Note: for performance reasons the list doesn't get cloned, so the caller of this method should not modify the list once passed in here.

Parameters
dataSourceSuppliers list of underlying suppliers

public boolean equals (Object other)

public DataSource<T> get ()

Retrieves an instance of the appropriate type. The returned object may or may not be a new instance, depending on the implementation.

Returns
  • an instance of the appropriate type

public int hashCode ()

public String toString ()