withCanvasSource
Adds a source to the canvas with the specified class and object. Allows for passing in a superclass as the retrieval type.
Return
This builder for method chaining
val testMosaic = mosaicBuilder()
.withCanvasSource(User::class, User("test-user"))
.withMockTile(MyTile, "test data")
.build()Parameters
The class of the object to register
The object to register
Adds a source to the canvas with the specified object.
Return
This builder for method chaining
val testMosaic = mosaicBuilder()
.withCanvasSource(User("test-user"))
.withMockTile(MyTile, "test data")
.build()Parameters
The object to register
Adds a source to the canvas with the specified class, qualifier, and object.
Return
This builder for method chaining
val testMosaic = mosaicBuilder()
.withCanvasSource(DatabaseService::class, "primary", primaryDb)
.withCanvasSource(DatabaseService::class, "secondary", secondaryDb)
.build()Parameters
The class of the object to register
The qualifier to distinguish this instance
The object to register
Adds a source to the canvas with the specified object and qualifier.
Return
This builder for method chaining
val testMosaic = mosaicBuilder()
.withCanvasSource("primary", primaryDb)
.withCanvasSource("secondary", secondaryDb)
.build()Parameters
The qualifier to distinguish this instance
The object to register
Adds a source to the canvas using a CanvasKey.
Return
This builder for method chaining
val dbKey = CanvasKey(DatabaseService::class, "primary")
val testMosaic = mosaicBuilder()
.withCanvasSource(dbKey, primaryDb)
.build()Parameters
The canvas key to register under
The object to register