| Class | Line # | Actions | |||||
|---|---|---|---|---|---|---|---|
| TestEntity | 34 | 0 | - | 0 | 0 |
| 1 | /* | |
| 2 | * See the NOTICE file distributed with this work for additional | |
| 3 | * information regarding copyright ownership. | |
| 4 | * | |
| 5 | * This is free software; you can redistribute it and/or modify it | |
| 6 | * under the terms of the GNU Lesser General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2.1 of | |
| 8 | * the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This software is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * Lesser General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU Lesser General Public | |
| 16 | * License along with this software; if not, write to the Free | |
| 17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
| 19 | */ | |
| 20 | ||
| 21 | package org.xwiki.security.authorization.testwikis; | |
| 22 | ||
| 23 | import java.util.Collection; | |
| 24 | ||
| 25 | import org.xwiki.model.EntityType; | |
| 26 | import org.xwiki.model.reference.EntityReference; | |
| 27 | ||
| 28 | /** | |
| 29 | * An generic interface for all test entities. | |
| 30 | * | |
| 31 | * @version $Id: 9254dbfdaa5caa7cdfc2c72fa94f9f9b64c7addb $ | |
| 32 | * @since 5.0M2 | |
| 33 | */ | |
| 34 | public interface TestEntity | |
| 35 | { | |
| 36 | /** | |
| 37 | * @return the reference of the entity represented by this test entity. | |
| 38 | */ | |
| 39 | EntityReference getReference(); | |
| 40 | ||
| 41 | /** | |
| 42 | * @return the type of reference used by this test entities. | |
| 43 | */ | |
| 44 | EntityType getType(); | |
| 45 | ||
| 46 | /** | |
| 47 | * Add a new child entity to this entity. | |
| 48 | * @param entity the child entity to be added. | |
| 49 | */ | |
| 50 | void add(TestEntity entity); | |
| 51 | ||
| 52 | /** | |
| 53 | * Retrieve a direct child entity from this entity. | |
| 54 | * @param reference a reference to the child entity. | |
| 55 | * @return a test entity if found, null otherwise. | |
| 56 | */ | |
| 57 | TestEntity getEntity(EntityReference reference); | |
| 58 | ||
| 59 | /** | |
| 60 | * @return a collection of all direct child entity of this entity. | |
| 61 | */ | |
| 62 | Collection<TestEntity> getEntities(); | |
| 63 | ||
| 64 | /** | |
| 65 | * Search for an entity in all descendant of this entity. | |
| 66 | * @param reference a reference to the search entity. | |
| 67 | * @return a test entity if found, null otherwise. | |
| 68 | */ | |
| 69 | TestEntity searchEntity(EntityReference reference); | |
| 70 | ||
| 71 | /** | |
| 72 | * @return the parent entity of this entity. | |
| 73 | */ | |
| 74 | TestEntity getParent(); | |
| 75 | } |