001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.masterindex.plugin.datamodel;
042:
043: /**
044: *
045: * This represents the fields of a ObjectDefinition like a Person can have
046: * firstName, lastName
047: *
048: * @author Sujit Biswas
049: *
050: */
051: public class Field {
052:
053: /**
054: * field name
055: */
056: private String name;
057:
058: /**
059: * field type
060: */
061: private String type;
062:
063: /**
064: * field size
065: */
066: private int size;
067:
068: /**
069: * is updateable
070: */
071: private boolean updateable;
072:
073: /**
074: * is required
075: */
076: private boolean required;
077:
078: /**
079: * is keyType
080: */
081: private boolean keyType;
082:
083: /**
084: * code-module
085: */
086:
087: private String codeModule;
088:
089: /**
090: * @param name
091: * @param type
092: * @param size
093: * @param updateable
094: * @param required
095: * @param keyType
096: * @param codeModule
097: */
098: public Field(String name, String type, int size,
099: boolean updateable, boolean required, boolean keyType,
100: String codeModule) {
101: this .name = name;
102: this .type = type;
103: this .size = size;
104: this .updateable = updateable;
105: this .required = required;
106: this .keyType = keyType;
107: this .codeModule = codeModule;
108: }
109:
110: /**
111: *
112: */
113: public Field() {
114: super ();
115: // TODO Auto-generated constructor stub
116: }
117:
118: /**
119: * @return the name
120: */
121: public String getName() {
122: return name;
123: }
124:
125: /**
126: * @param name
127: * the name to set
128: */
129: public void setName(String name) {
130: this .name = name;
131: }
132:
133: /**
134: * @return the type
135: */
136: public String getType() {
137: return type;
138: }
139:
140: /**
141: * @param type
142: * the type to set
143: */
144: public void setType(String type) {
145: this .type = type;
146: }
147:
148: /**
149: * @return the keyType
150: */
151: public boolean isKeyType() {
152: return keyType;
153: }
154:
155: /**
156: * @param keyType
157: * the keyType to set
158: */
159: public void setKeyType(boolean keyType) {
160: this .keyType = keyType;
161: }
162:
163: /**
164: * @return the required
165: */
166: public boolean isRequired() {
167: return required;
168: }
169:
170: /**
171: * @param required
172: * the required to set
173: */
174: public void setRequired(boolean required) {
175: this .required = required;
176: }
177:
178: /**
179: * @return the size
180: */
181: public int getSize() {
182: return size;
183: }
184:
185: /**
186: * @param size
187: * the size to set
188: */
189: public void setSize(int size) {
190: this .size = size;
191: }
192:
193: /**
194: * @return the updateable
195: */
196: public boolean isUpdateable() {
197: return updateable;
198: }
199:
200: /**
201: * @param updateable
202: * the updateable to set
203: */
204: public void setUpdateable(boolean updateable) {
205: this .updateable = updateable;
206: }
207:
208: /*
209: * (non-Javadoc)
210: *
211: * @see java.lang.Object#toString()
212: */
213: @Override
214: public String toString() {
215: String s = "name=" + name + ",type=" + type + ",size=" + size
216: + ",keyType=" + keyType + ",required=" + required
217: + ",codeModule=" + codeModule + ",updateable="
218: + updateable;
219: return s;
220: }
221:
222: /**
223: * @return the codeModule
224: */
225: public String getCodeModule() {
226: return codeModule;
227: }
228:
229: /**
230: * @param codeModule the codeModule to set
231: */
232: public void setCodeModule(String codeModule) {
233: this.codeModule = codeModule;
234: }
235:
236: }
|