1
|
/**
|
2
|
* Copyright (C) 2014 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.service;
|
10
|
|
11
|
import java.util.UUID;
|
12
|
|
13
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
14
|
|
15
|
/**
|
16
|
* @author cmathew
|
17
|
* @date 14 Oct 2014
|
18
|
*/
|
19
|
public interface ICachedCommonService {
|
20
|
|
21
|
public CdmBase find(Class<? extends CdmBase> clazz, int id);
|
22
|
|
23
|
/**
|
24
|
* Initializes a collection or map.
|
25
|
*
|
26
|
* @param ownerUuid uuid of owner cdm entity
|
27
|
* @param fieldName field name of collection or map
|
28
|
* @return initialised collection or map
|
29
|
*/
|
30
|
public Object initializeCollection(UUID ownerUuid, String fieldName);
|
31
|
|
32
|
/**
|
33
|
* Checks if a collection or map is empty.
|
34
|
*
|
35
|
* @param ownerUuid uuid of owner cdm entity
|
36
|
* @param fieldName field name of collection or map
|
37
|
* @return true if the collection of map is empty, else false
|
38
|
*/
|
39
|
public boolean isEmpty(UUID ownerUuid, String fieldName);
|
40
|
|
41
|
/**
|
42
|
* Returns the size of requested collection or map.
|
43
|
*
|
44
|
* @param ownerUuid uuid of owner cdm entity
|
45
|
* @param fieldName field name of collection or map
|
46
|
* @return the size of the persistent collection
|
47
|
*/
|
48
|
public int size(UUID ownerUuid, String fieldName);
|
49
|
|
50
|
/**
|
51
|
* Checks whether an object is contained within a persistent collection.
|
52
|
*
|
53
|
* @param ownerUuid uuid of owner cdm entity
|
54
|
* @param fieldName field name of collection or map
|
55
|
* @param element the element to check for
|
56
|
* @return true if the element exists in the collection, false o/w
|
57
|
*/
|
58
|
public boolean contains(UUID ownerUuid, String fieldName, Object element);
|
59
|
|
60
|
/**
|
61
|
* Checks whether an index object exists within a persistent collection
|
62
|
* (usually a map)
|
63
|
*
|
64
|
* @param ownerUuid uuid of owner cdm entity
|
65
|
* @param fieldName field name of map
|
66
|
* @param key the index object to look for.
|
67
|
* @return true if the index object exists in the collection, false o/w
|
68
|
*/
|
69
|
public boolean containsKey(UUID ownerUuid, String fieldName, Object key);
|
70
|
|
71
|
/**
|
72
|
* checks whether an value object exists within a persistent collection
|
73
|
* (usually a map)
|
74
|
*
|
75
|
* @param ownerUuid uuid of owner cdm entity
|
76
|
* @param fieldName field name of map
|
77
|
* @param key the value object to look for.
|
78
|
* @return true if the value object exists in the collection, false o/w
|
79
|
*/
|
80
|
public boolean containsValue(UUID ownerUuid, String fieldName, Object element);
|
81
|
}
|