QualifiedContent

interface QualifiedContent
com.android.build.api.transform.QualifiedContent

Represent content qualified with one or more ContentType and one or more Scope.

Summary

Nested classes

abstract

A content type that is requested through the transform API.

The type of of the content.

The scope of the content.

abstract

Definition of a scope.

Public methods

abstract MutableSet<QualifiedContent.ContentType!>

Returns the type of content that the stream represents.

abstract File

Returns he location of the content.

abstract String

Returns the name of the content.

abstract MutableSet<in QualifiedContent.Scope!>

Returns the scope of the content.

Public methods

getContentTypes

@NonNull abstract fun getContentTypes(): MutableSet<QualifiedContent.ContentType!>

Returns the type of content that the stream represents.

Even though this may return only DefaultContentType#RESOURCES or DefaultContentType#CLASSES, the actual content (the folder or the jar) may contain files representing other content types. This is because the transform mechanism avoids duplicating files around to remove unwanted types for performance.

For each input, transforms should always take care to read and process only the files associated with the types returned by this method.

Return
MutableSet<QualifiedContent.ContentType!>: a set of one or more types, never null nor empty.

getFile

@NonNull abstract fun getFile(): File

Returns he location of the content.

Return
File: the content location.

getName

@NonNull abstract fun getName(): String

Returns the name of the content. Can be used to differentiate different content using the same scope. This is not reliably usable at every stage of the transformations, but can be used for logging for instance.

Return
String: the name

getScopes

@NonNull abstract fun getScopes(): MutableSet<in QualifiedContent.Scope!>

Returns the scope of the content.

Return
MutableSet<in QualifiedContent.Scope!>: a set of one or more scopes, never null nor empty.