1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.chemistry.opencmis.client.api;
20
21 import java.util.List;
22
23 import org.apache.chemistry.opencmis.commons.data.AllowableActions;
24 import org.apache.chemistry.opencmis.commons.data.PropertyData;
25
26 /**
27 * Query result.
28 */
29 public interface QueryResult {
30
31 /**
32 * Returns a list of all properties in this query result.
33 */
34 List<PropertyData<?>> getProperties();
35
36 /**
37 * Returns a property by id.
38 * <p>
39 * Since repositories are not obligated to add property ids to their query
40 * result properties, this method might not always work as expected with
41 * some repositories. Use {@link #getPropertyByQueryName(String)} instead.
42 */
43 <T> PropertyData<T> getPropertyById(String id);
44
45 /**
46 * Returns a property by query name or alias.
47 */
48 <T> PropertyData<T> getPropertyByQueryName(String queryName);
49
50 /**
51 * Returns a property (single) value by id.
52 *
53 * @see #getPropertyById(String)
54 */
55 <T> T getPropertyValueById(String id);
56
57 /**
58 * Returns a property (single) value by query name or alias.
59 *
60 * @see #getPropertyByQueryName(String)
61 */
62 <T> T getPropertyValueByQueryName(String queryName);
63
64 /**
65 * Returns a property multi-value by id.
66 *
67 * @see #getPropertyById(String)
68 */
69 <T> List<T> getPropertyMultivalueById(String id);
70
71 /**
72 * Returns a property multi-value by query name or alias.
73 *
74 * @see #getPropertyByQueryName(String)
75 */
76 <T> List<T> getPropertyMultivalueByQueryName(String queryName);
77
78 /**
79 * Returns the allowable actions if they were requested.
80 */
81 AllowableActions getAllowableActions();
82
83 /**
84 * Returns the relationships if they were requested.
85 */
86 List<Relationship> getRelationships();
87
88 /**
89 * Returns the renditions if they were requested.
90 */
91 List<Rendition> getRenditions();
92 }