ServicesBuilder

Builds a list of Publication.Service from a collection of service factories.

Provides helpers to manipulate the list of services of a Publication.

Constructors

Link copied to clipboard
constructor(cache: ServiceFactory? = null, content: ServiceFactory? = null, contentProtection: ServiceFactory? = null, cover: ServiceFactory? = null, locator: ServiceFactory? = null, positions: ServiceFactory? = null, search: ServiceFactory? = null)

Properties

Functions

Link copied to clipboard

Builds the actual list of publication services to use in a Publication.

Link copied to clipboard
fun <T : Publication.Service> decorate(serviceType: KClass<T>, transform: (ServiceFactory?) -> ServiceFactory)

Replaces the service factory associated with the given service type with the result of transform.

Link copied to clipboard
operator fun <T : Publication.Service> get(serviceType: KClass<T>): ServiceFactory?

Gets the publication service factory for the given service type.

Link copied to clipboard
fun <T : Publication.Service> remove(serviceType: KClass<T>)

Removes the service factory producing the given kind of service, if any.

Link copied to clipboard
operator fun <T : Publication.Service> set(serviceType: KClass<T>, factory: ServiceFactory?)

Sets the publication service factory for the given service type.