@Immutable
public static final class FileCache.Inputs
extends java.lang.Object
FileCache.
The clients of FileCache need to exhaustively specify all the inputs that affect
the creation of an output file/directory to the FileCache.Inputs object, including a command
for the file creator callback function, the input files/directories and other input
parameters. A command identifies a file creator (which usually corresponds to a Gradle task)
and is used to separate the cached results of different file creators when they use the same
cache. If the client uses a different file creator, or changes the file creator's
implementation, then it needs to provide a new unique command. For input files/directories,
it is important to select a combination of properties that uniquely identifies an input
file/directory with consideration of their impact on correctness and performance (see FileCache.FileProperties and FileCache.DirectoryProperties).
When constructing the FileCache.Inputs object, the client is required to provide the command
(via the FileCache.Inputs.Builder constructor) and at least one other input parameter.
The input parameters have the order in which they were added to this Inputs
object. They are not allowed to have the same name (an exception will be thrown if a
parameter with the same name already exists).
Note that if some inputs are missing, the cache may return a cached file/directory that is incorrect. On the other hand, if some irrelevant inputs are included, the cache may create a new cached file/directory even though an existing one can be used. In other words, missing inputs affect correctness, and irrelevant inputs affect performance. Thus, the client needs to consider carefully what to include and exclude in these inputs.
| Modifier and Type | Class and Description |
|---|---|
static class |
FileCache.Inputs.Builder
Builder of
FileCache.Inputs. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getKey()
Returns a key representing this list of input parameters.
|
java.lang.String |
toString() |
@NonNull public java.lang.String toString()
toString in class java.lang.Object@NonNull public java.lang.String getKey()
Two lists of input parameters are considered different if the input parameters are different in size, names, order, or values. This method is guaranteed to return different keys for different lists of inputs.