2 * Copyright (C) 2014 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.service
;
11 import java
.util
.UUID
;
13 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
20 public interface ICachedCommonService
{
22 public CdmBase
find(Class
<?
extends CdmBase
> clazz
, int id
);
26 * Initializes a collection or map.
28 * @param ownerUuid uuid of owner cdm entity
29 * @param fieldName field name of collection or map
30 * @return initialised collection or map
32 public Object
initializeCollection(UUID ownerUuid
, String fieldName
);
35 * Checks if a collection or map is empty.
37 * @param ownerUuid uuid of owner cdm entity
38 * @param fieldName field name of collection or map
39 * @return true if the collection of map is empty, else false
41 public boolean isEmpty(UUID ownerUuid
, String fieldName
);
44 * Returns the size of requested collection or map.
46 * @param ownerUuid uuid of owner cdm entity
47 * @param fieldName field name of collection or map
48 * @return the size of the persistent collection
50 public int size(UUID ownerUuid
, String fieldName
);
53 * Checks whether an object is contained within a persistent collection.
55 * @param ownerUuid uuid of owner cdm entity
56 * @param fieldName field name of collection or map
57 * @param element the element to check for
58 * @return true if the element exists in the collection, false o/w
60 public boolean contains(UUID ownerUuid
, String fieldName
, Object element
);
63 * Checks whether an index object exists within a persistent collection
66 * @param ownerUuid uuid of owner cdm entity
67 * @param fieldName field name of map
68 * @param key the index object to look for.
69 * @return true if the index object exists in the collection, false o/w
71 public boolean containsKey(UUID ownerUuid
, String fieldName
, Object key
);
74 * checks whether an value object exists within a persistent collection
77 * @param ownerUuid uuid of owner cdm entity
78 * @param fieldName field name of map
79 * @param key the value object to look for.
80 * @return true if the value object exists in the collection, false o/w
82 public boolean containsValue(UUID ownerUuid
, String fieldName
, Object element
);