1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.errors;
12
13 import java.io.IOException;
14 import java.text.MessageFormat;
15 import java.util.Collection;
16
17 import org.eclipse.jgit.internal.JGitText;
18 import org.eclipse.jgit.lib.AbbreviatedObjectId;
19 import org.eclipse.jgit.lib.ObjectId;
20
21
22
23
24 public class AmbiguousObjectException extends IOException {
25 private static final long serialVersionUID = 1L;
26
27 private final AbbreviatedObjectId missing;
28
29 private final Collection<ObjectId> candidates;
30
31
32
33
34
35
36
37
38
39
40 public AmbiguousObjectException(final AbbreviatedObjectId id,
41 final Collection<ObjectId> candidates) {
42 super(MessageFormat.format(JGitText.get().ambiguousObjectAbbreviation,
43 id.name()));
44 this.missing = id;
45 this.candidates = candidates;
46 }
47
48
49
50
51
52
53 public AbbreviatedObjectId getAbbreviatedObjectId() {
54 return missing;
55 }
56
57
58
59
60
61
62 public Collection<ObjectId> getCandidates() {
63 return candidates;
64 }
65 }