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.definitions.TypeDefinition; 24 25 /** 26 * Object Type. 27 * 28 * @cmis 1.0 29 */ 30 public interface ObjectType extends TypeDefinition { 31 32 /** 33 * Indicates whether this is base object type or not. 34 * 35 * @return {@code true} if this type is a base type, {@code false} if this 36 * type is a derived type 37 * 38 * @cmis 1.0 39 */ 40 boolean isBaseType(); 41 42 /** 43 * Gets the types base type, if the type is a derived (non-base) type. 44 * 45 * @return the base type this type is derived from, or {@code null} if it is 46 * a base type 47 * 48 * @cmis 1.0 49 */ 50 ObjectType getBaseType(); 51 52 /** 53 * Gets the types parent type, if the type is a derived (non-base) type. 54 * 55 * @return the parent type from which this type is derived, or {@code null} 56 * if it is a base type 57 * 58 * @cmis 1.0 59 */ 60 ObjectType getParentType(); 61 62 /** 63 * Gets the list of types directly derived from this type (which will return 64 * this type on {@code getParent()}). 65 * 66 * @return list of types which are directly derived from this type 67 * 68 * @cmis 1.0 69 */ 70 ItemIterable<ObjectType> getChildren(); 71 72 /** 73 * Gets the list of all types somehow derived from this type. 74 * 75 * @param depth 76 * the tree depth, must be greater than 0 or -1 for infinite 77 * depth 78 * 79 * @return a list of trees of types which are derived from this type (direct 80 * and via their parents) 81 * 82 * @cmis 1.0 83 */ 84 List<Tree<ObjectType>> getDescendants(int depth); 85 86 }