]>
git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/diff/DiffNotMatched.java
8a6e0f747090eedfca302194f2c202c53dba59f2
2 * Copyright (C) 2007-2012 Mathieu Baudier
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.slc
.diff
;
18 import org
.argeo
.slc
.SlcException
;
20 /** Diff issue where reached and expected values are different. */
21 public class DiffNotMatched
extends DiffIssueKey
{
23 // To enable hibernate persistance, these object cannot be final
24 // private final Object expected;
25 // private final Object reached;
27 private Object expected
;
28 private Object reached
;
30 public DiffNotMatched(DiffPosition position
, Object expected
, Object reached
) {
32 this.expected
= expected
;
33 this.reached
= reached
;
36 public DiffNotMatched(DiffPosition position
, Object expected
,
37 Object reached
, DiffKey key
) {
39 this.expected
= expected
;
40 this.reached
= reached
;
43 public Object
getExpected() {
47 public Object
getReached() {
52 public String
toString() {
53 String result
= position
+ ": not matched " + expected
+ " <> "
55 if (super.key
!= null) {
56 result
= result
+ " - Key: " + super.toString();
62 @SuppressWarnings("unused")
63 private String
getExpectedStr() {
64 if (expected
instanceof String
)
65 return (String
) expected
;
67 throw new SlcException(
68 "Object 'expected' is of wrong type. Must be a String");
71 @SuppressWarnings("unused")
72 private String
getReachedStr() {
73 if (reached
instanceof String
)
74 return (String
) reached
;
76 throw new SlcException(
77 "Object 'reached' is of wrong type. Must be a String");
80 @SuppressWarnings("unused")
81 private void setReachedStr(String reachedStr
) {
82 this.reached
= reachedStr
;
85 @SuppressWarnings("unused")
86 private void setExpectedStr(String expectedStr
) {
87 this.expected
= expectedStr
;