-
public final class FakeImageLoaderEngine.Builder
-
-
Constructor Summary
Constructors Constructor Description FakeImageLoaderEngine.Builder()FakeImageLoaderEngine.Builder(FakeImageLoaderEngine engine)
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>intercept(Object data, Drawable drawable)Add an interceptor that will return Drawable if data is equal to an incoming ImageRequest's data. final <ERROR CLASS>intercept(Function1<Object, Boolean> predicate, Drawable drawable)Add an interceptor that will return Drawable if predicate returns true.final <ERROR CLASS>intercept(Function1<Object, Boolean> predicate, FakeImageLoaderEngine.OptionalInterceptor interceptor)Add an interceptor that will call interceptor if predicate returns true.final <ERROR CLASS>addInterceptor(FakeImageLoaderEngine.OptionalInterceptor interceptor)Add an OptionalInterceptor. final <ERROR CLASS>removeInterceptor(FakeImageLoaderEngine.OptionalInterceptor interceptor)Remove interceptor from the list of OptionalInterceptors. final <ERROR CLASS>clearInterceptors()Remove all OptionalInterceptors. final <ERROR CLASS>default(Drawable drawable)Set a default Drawable that will be returned if no OptionalInterceptors handle the request. final <ERROR CLASS>default(Interceptor interceptor)Set the default Interceptor that will be called if no OptionalInterceptors handle the request. final <ERROR CLASS>requestTransformer(FakeImageLoaderEngine.RequestTransformer transformer)Set a callback to modify an incoming ImageRequest before it's handled by the interceptors. final FakeImageLoaderEnginebuild()Create a new FakeImageLoaderEngine instance. -
-
Constructor Detail
-
FakeImageLoaderEngine.Builder
FakeImageLoaderEngine.Builder()
-
FakeImageLoaderEngine.Builder
FakeImageLoaderEngine.Builder(FakeImageLoaderEngine engine)
-
-
Method Detail
-
intercept
final <ERROR CLASS> intercept(Function1<Object, Boolean> predicate, FakeImageLoaderEngine.OptionalInterceptor interceptor)
Add an interceptor that will call interceptor if predicate returns
true.
-
addInterceptor
final <ERROR CLASS> addInterceptor(FakeImageLoaderEngine.OptionalInterceptor interceptor)
Add an OptionalInterceptor.
-
removeInterceptor
final <ERROR CLASS> removeInterceptor(FakeImageLoaderEngine.OptionalInterceptor interceptor)
Remove interceptor from the list of OptionalInterceptors.
-
clearInterceptors
final <ERROR CLASS> clearInterceptors()
Remove all OptionalInterceptors.
-
default
final <ERROR CLASS> default(Drawable drawable)
Set a default Drawable that will be returned if no OptionalInterceptors handle the request. If a default is not set, any requests not handled by an OptionalInterceptor will throw an exception.
-
default
final <ERROR CLASS> default(Interceptor interceptor)
Set the default Interceptor that will be called if no OptionalInterceptors handle the request. If a default is not set, any requests not handled by an OptionalInterceptor will throw an exception.
-
requestTransformer
final <ERROR CLASS> requestTransformer(FakeImageLoaderEngine.RequestTransformer transformer)
Set a callback to modify an incoming ImageRequest before it's handled by the interceptors.
By default, FakeImageLoaderEngine uses this callback to clear an ImageRequest's transition and setting this callback replaces that behaviour.
-
build
final FakeImageLoaderEngine build()
Create a new FakeImageLoaderEngine instance.
-
-
-
-