]>
git.argeo.org Git - gpl/argeo-slc.git/blob - cms/org.argeo.slc.support/src/org/argeo/slc/diff/DiffNotMatched.java
1 package org
.argeo
.slc
.diff
;
3 import org
.argeo
.slc
.SlcException
;
5 /** Diff issue where reached and expected values are different. */
6 public class DiffNotMatched
extends DiffIssueKey
{
8 // To enable hibernate persistance, these object cannot be final
9 // private final Object expected;
10 // private final Object reached;
12 private Object expected
;
13 private Object reached
;
15 public DiffNotMatched(DiffPosition position
, Object expected
, Object reached
) {
17 this.expected
= expected
;
18 this.reached
= reached
;
21 public DiffNotMatched(DiffPosition position
, Object expected
,
22 Object reached
, DiffKey key
) {
24 this.expected
= expected
;
25 this.reached
= reached
;
28 public Object
getExpected() {
32 public Object
getReached() {
37 public String
toString() {
38 String result
= position
+ ": not matched " + expected
+ " <> "
40 if (super.key
!= null) {
41 result
= result
+ " - Key: " + super.toString();
47 @SuppressWarnings("unused")
48 private String
getExpectedStr() {
49 if (expected
instanceof String
)
50 return (String
) expected
;
52 throw new SlcException(
53 "Object 'expected' is of wrong type. Must be a String");
56 @SuppressWarnings("unused")
57 private String
getReachedStr() {
58 if (reached
instanceof String
)
59 return (String
) reached
;
61 throw new SlcException(
62 "Object 'reached' is of wrong type. Must be a String");
65 @SuppressWarnings("unused")
66 private void setReachedStr(String reachedStr
) {
67 this.reached
= reachedStr
;
70 @SuppressWarnings("unused")
71 private void setExpectedStr(String expectedStr
) {
72 this.expected
= expectedStr
;