• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.google.android.libraries.mobiledatadownload.downloader;
17 
18 import com.google.android.libraries.mobiledatadownload.FileSource;
19 import com.google.auto.value.AutoValue;
20 import javax.annotation.concurrent.Immutable;
21 
22 /** Parameters for downloading inline (in-memory and URI) files. */
23 @Immutable
24 @AutoValue
25 public abstract class InlineDownloadParams {
InlineDownloadParams()26   InlineDownloadParams() {}
27 
28   /** The data that should be copied to MDD internal storage. */
inlineFileContent()29   public abstract FileSource inlineFileContent();
30 
31   /** Creates a Builder for {@link InlineDownloadParams} */
newBuilder()32   public static Builder newBuilder() {
33     return new AutoValue_InlineDownloadParams.Builder();
34   }
35 
36   /** Builder for {@link InlineDownloadParams} */
37   @AutoValue.Builder
38   public abstract static class Builder {
Builder()39     Builder() {}
40 
41     /** Sets the in-memory data that should be copied to MDD internal storage. */
setInlineFileContent(FileSource inlineFileContent)42     public abstract Builder setInlineFileContent(FileSource inlineFileContent);
43 
44     /** Builds a {@link InlineDownloadParams}. */
build()45     public abstract InlineDownloadParams build();
46   }
47 }
48