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.model;
18
 
19
import org.json.JSONArray;
20
 
21
import java.util.List;
22
 
23
/**
24
 * GraphObjectList is the primary representation of a collection of graph objects in the Facebook SDK for Android.
25
 * It is not implemented by any concrete classes, but rather by a proxy (see the {@link com.facebook.model.GraphObject.Factory Factory}
26
 * class). A GraphObjectList can actually contain elements of any type, not just graph objects, but its principal
27
 * use in the SDK is to contain types derived from GraphObject.
28
 * <br/>
29
 *
30
 * @param <T> the type of elements in the list
31
 */
32
public interface GraphObjectList<T> extends List<T> {
33
    // cast method is only supported if T extends GraphObject
34
    /**
35
     * If T is derived from GraphObject, returns a new GraphObjectList exposing the same underlying data as a new
36
     * GraphObject-derived type.
37
     * @param graphObjectClass the GraphObject-derived type to return a list of
38
     * @return a list representing the same underlying data, exposed as the new GraphObject-derived type
39
     * @throws com.facebook.FacebookGraphObjectException if T does not derive from GraphObject
40
     */
41
    public <U extends GraphObject> GraphObjectList<U> castToListOf(Class<U> graphObjectClass);
42
    /**
43
     * Gets the underlying JSONArray representation of the data.
44
     * @return the underlying JSONArray representation of the data
45
     */
46
    public JSONArray getInnerJSONArray();
47
}