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 the list of all properties in this query result. 33 * 34 * @return all properties, not {@code null} 35 */ 36 List<PropertyData<?>> getProperties(); 37 38 /** 39 * Returns a property by ID. 40 * <p> 41 * Because repositories are not obligated to add property IDs to their query 42 * result properties, this method might not always work as expected with 43 * some repositories. Use {@link #getPropertyByQueryName(String)} instead. 44 * 45 * @param id 46 * the property ID 47 * 48 * @return the property or {@code null} if the property doesn't exist or 49 * hasn't been requested 50 */ 51 <T> PropertyData<T> getPropertyById(String id); 52 53 /** 54 * Returns a property by query name or alias. 55 * 56 * @param queryName 57 * the property query name or alias 58 * 59 * @return the property or {@code null} if the property doesn't exist or 60 * hasn't been requested 61 * 62 */ 63 <T> PropertyData<T> getPropertyByQueryName(String queryName); 64 65 /** 66 * Returns a property (single) value by ID. 67 * 68 * @param id 69 * the property ID 70 * 71 * @see #getPropertyById(String) 72 */ 73 <T> T getPropertyValueById(String id); 74 75 /** 76 * Returns a property (single) value by query name or alias. 77 * 78 * @param queryName 79 * the property query name or alias 80 * 81 * @return the property value or {@code null} if the property doesn't exist, 82 * hasn't been requested, or the property value isn't set 83 * 84 * @see #getPropertyByQueryName(String) 85 */ 86 <T> T getPropertyValueByQueryName(String queryName); 87 88 /** 89 * Returns a property multi-value by ID. 90 * 91 * @param id 92 * the property ID 93 * 94 * @return the property value or {@code null} if the property doesn't exist, 95 * hasn't been requested, or the property value isn't set 96 * 97 * @see #getPropertyById(String) 98 */ 99 <T> List<T> getPropertyMultivalueById(String id); 100 101 /** 102 * Returns a property multi-value by query name or alias. 103 * 104 * @param queryName 105 * the property query name or alias 106 * 107 * @return the property value or {@code null} if the property doesn't exist, 108 * hasn't been requested, or the property value isn't set 109 * 110 * @see #getPropertyByQueryName(String) 111 */ 112 <T> List<T> getPropertyMultivalueByQueryName(String queryName); 113 114 /** 115 * Returns the allowable actions if they have been requested. 116 * 117 * @return the allowable actions if they have been requested, {@code null} 118 * otherwise 119 */ 120 AllowableActions getAllowableActions(); 121 122 /** 123 * Returns the relationships if they have been requested. 124 * 125 * @return the relationships if they have been requested, {@code null} 126 * otherwise 127 */ 128 List<Relationship> getRelationships(); 129 130 /** 131 * Returns the renditions if they have been requested. 132 * 133 * @return the rendition if they have been requested, {@code null} otherwise 134 */ 135 List<Rendition> getRenditions(); 136 }