3 * Copyright (C) 2014 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.service
;
12 import java
.util
.UUID
;
14 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
21 public interface ICachedCommonService
{
23 public CdmBase
find(Class
<?
extends CdmBase
> clazz
, int id
);
27 * Initializes a collection or map.
29 * @param ownerUuid uuid of owner cdm entity
30 * @param fieldName field name of collection or map
31 * @return initialised collection or map
33 public Object
initializeCollection(UUID ownerUuid
, String fieldName
);
36 * Checks if a collection or map is empty.
38 * @param ownerUuid uuid of owner cdm entity
39 * @param fieldName field name of collection or map
40 * @return true if the collection of map is empty, else false
42 public boolean isEmpty(UUID ownerUuid
, String fieldName
);
45 * Returns the size of requested collection or map.
47 * @param ownerUuid uuid of owner cdm entity
48 * @param fieldName field name of collection or map
49 * @return the size of the persistent collection
51 public int size(UUID ownerUuid
, String fieldName
);
54 * Checks whether an object is contained within a persistent collection.
56 * @param ownerUuid uuid of owner cdm entity
57 * @param fieldName field name of collection or map
58 * @param element the element to check for
59 * @return true if the element exists in the collection, false o/w
61 public boolean contains(UUID ownerUuid
, String fieldName
, Object element
);
64 * Checks whether an index object exists within a persistent collection
67 * @param ownerUuid uuid of owner cdm entity
68 * @param fieldName field name of map
69 * @param key the index object to look for.
70 * @return true if the index object exists in the collection, false o/w
72 public boolean containsKey(UUID ownerUuid
, String fieldName
, Object key
);
75 * checks whether an value object exists within a persistent collection
78 * @param ownerUuid uuid of owner cdm entity
79 * @param fieldName field name of map
80 * @param key the value object to look for.
81 * @return true if the value object exists in the collection, false o/w
83 public boolean containsValue(UUID ownerUuid
, String fieldName
, Object element
);