1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.oness.common.model.exceptions;
17
18 import java.util.Collection;
19
20 /***
21 * Exception thrown when trying to create an object similar to others
22 * that already exist
23 *
24 * @author Carlos Sanchez
25 * @version $Revision: 1.3 $
26 */
27 public class ExistingInstanceException extends ModelException {
28
29 private Object object;
30 private String className;
31 private Collection existingInstances;
32
33 /***
34 * @param object
35 * @param className name of the object class
36 * @param existingInstances
37 */
38 public ExistingInstanceException(
39 Object object,
40 String className,
41 Collection existingInstances) {
42 super("Existing instance");
43 this.object = object;
44 this.className = className;
45 this.existingInstances = existingInstances;
46 }
47
48 public Object getObject() {
49 return object;
50 }
51
52 public String getClassName() {
53 return className;
54 }
55
56 public Collection getExistingInstances() {
57 return existingInstances;
58 }
59
60 }