1 /*
2 * PROJECT : DAR Runtime and Tools
3 * COPYRIGHT : Copyright (C) 1999-2004 tim.stephenson@enableit.org
4 * LICENSE : GNU LESSER GENERAL PUBLIC LICENSE
5 * Version 2.1, February 1999
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 package org.enableit.db.darrt.beans;
22
23
24 /*** @author default */
25 public class DiffData {
26 // Member properties ----------------------------------------------------------
27 private Object refObj;
28 private Object targetObj;
29
30 /***
31 * The name the object is referred to by.
32 */
33 private String name;
34
35 /***
36 * The type the object.
37 */
38 private String type;
39
40 /***
41 * Default constructor.
42 */
43 public DiffData() {
44 }
45
46 /*** @param refObj
47 * @param targetObj */
48 public DiffData(String name, String type, Object refObj, Object targetObj) {
49 setName(name);
50 setType(type);
51 setRefObj(refObj);
52 setTargetObj(targetObj);
53 }
54
55 public String getName() {
56 return name;
57 }
58
59 public void setName(String name) {
60 this.name = name;
61 }
62
63 public String getType() {
64 return type;
65 }
66
67 public void setType(String type) {
68 this.type = type;
69 }
70
71 public Object getRefObj() {
72 return refObj;
73 }
74
75 public Object getTargetObj() {
76 return targetObj;
77 }
78
79 /*** @param newRefObj */
80 public void setRefObj(Object newRefObj) {
81 this.refObj = newRefObj;
82 }
83
84 /*** @param newTargetObj */
85 public void setTargetObj(Object newTargetObj) {
86 this.targetObj = newTargetObj;
87 }
88
89 /***
90 * @return true if the represented difference is completely missing
91 * from the target schema.
92 */
93 public boolean isMissingFromTarget() {
94 boolean retVal;
95
96 if (getTargetObj() == null) {
97 retVal = true;
98 } else {
99 retVal = false;
100 }
101
102 return retVal;
103 }
104
105 /***
106 * Returns true if the represented difference is completely missing
107 * from the reference schema.
108 */
109 public boolean isMissingFromReference() {
110 boolean retVal;
111
112 if (getRefObj() == null) {
113 retVal = true;
114 } else {
115 retVal = false;
116 }
117
118 return retVal;
119 }
120
121 /***
122 * Assist with debugging.
123 * @return Stringified representation of class.
124 */
125 public String toString() {
126 StringBuffer sb = new StringBuffer();
127
128 sb.append(this.getClass().getName() + "[");
129
130 sb.append("name=" + name);
131 sb.append(", type=" + type);
132 sb.append(", refObj=" + refObj);
133 sb.append(", targetObj=" + targetObj);
134
135 sb.append("]");
136
137 return sb.toString();
138 }
139 }
This page was automatically generated by Maven