Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14792 manas 1
/**
2
 * Copyright 2010-present Facebook.
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
 
17
package com.facebook.internal;
18
 
19
import com.facebook.Request;
20
import com.facebook.RequestBatch;
21
 
22
/**
23
 * com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
24
 * any of the classes in this package is unsupported, and they may be modified or removed without warning at
25
 * any time.
26
 */
27
public class CacheableRequestBatch extends RequestBatch {
28
    private String cacheKey;
29
    private boolean forceRoundTrip;
30
 
31
    public CacheableRequestBatch() {
32
    }
33
 
34
    public CacheableRequestBatch(Request... requests) {
35
        super(requests);
36
    }
37
 
38
    public final String getCacheKeyOverride() {
39
        return cacheKey;
40
    }
41
 
42
    // If this is set, the provided string will override the default key (the URL) for single requests.
43
    // There is no default for multi-request batches, so no caching will be done unless the override is
44
    // specified.
45
    public final void setCacheKeyOverride(String cacheKey) {
46
        this.cacheKey = cacheKey;
47
    }
48
 
49
    public final boolean getForceRoundTrip() {
50
        return forceRoundTrip;
51
    }
52
 
53
    public final void setForceRoundTrip(boolean forceRoundTrip) {
54
        this.forceRoundTrip = forceRoundTrip;
55
    }
56
 
57
}