001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/integration/api/src/java/org/theospi/portfolio/admin/model/IntegrationOption.java $
003: * $Id: IntegrationOption.java 11372 2006-06-29 14:58:30Z chmaurer@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.theospi.portfolio.admin.model;
021:
022: import org.apache.commons.logging.Log;
023: import org.apache.commons.logging.LogFactory;
024:
025: public class IntegrationOption implements Cloneable {
026: protected final transient Log logger = LogFactory
027: .getLog(getClass());
028:
029: private String label;
030: private boolean include = true;
031:
032: public IntegrationOption() {
033: }
034:
035: public IntegrationOption(boolean include, String label) {
036: this .include = include;
037: this .label = label;
038: }
039:
040: public IntegrationOption(IntegrationOption copy) {
041: this .include = copy.include;
042: this .label = copy.label;
043: }
044:
045: public boolean isInclude() {
046: return include;
047: }
048:
049: public void setInclude(boolean include) {
050: this .include = include;
051: }
052:
053: public String getLabel() {
054: return label;
055: }
056:
057: public void setLabel(String label) {
058: this .label = label;
059: }
060:
061: /**
062: * Creates and returns a copy of this object. The precise meaning
063: * of "copy" may depend on the class of the object. The general
064: * intent is that, for any object <tt>x</tt>, the expression:
065: * <blockquote>
066: * <pre>
067: * x.clone() != x</pre></blockquote>
068: * will be true, and that the expression:
069: * <blockquote>
070: * <pre>
071: * x.clone().getClass() == x.getClass()</pre></blockquote>
072: * will be <tt>true</tt>, but these are not absolute requirements.
073: * While it is typically the case that:
074: * <blockquote>
075: * <pre>
076: * x.clone().equals(x)</pre></blockquote>
077: * will be <tt>true</tt>, this is not an absolute requirement.
078: * <p/>
079: * By convention, the returned object should be obtained by calling
080: * <tt>super.clone</tt>. If a class and all of its superclasses (except
081: * <tt>Object</tt>) obey this convention, it will be the case that
082: * <tt>x.clone().getClass() == x.getClass()</tt>.
083: * <p/>
084: * By convention, the object returned by this method should be independent
085: * of this object (which is being cloned). To achieve this independence,
086: * it may be necessary to modify one or more fields of the object returned
087: * by <tt>super.clone</tt> before returning it. Typically, this means
088: * copying any mutable objects that comprise the internal "deep structure"
089: * of the object being cloned and replacing the references to these
090: * objects with references to the copies. If a class contains only
091: * primitive fields or references to immutable objects, then it is usually
092: * the case that no fields in the object returned by <tt>super.clone</tt>
093: * need to be modified.
094: * <p/>
095: * The method <tt>clone</tt> for class <tt>Object</tt> performs a
096: * specific cloning operation. First, if the class of this object does
097: * not implement the interface <tt>Cloneable</tt>, then a
098: * <tt>CloneNotSupportedException</tt> is thrown. Note that all arrays
099: * are considered to implement the interface <tt>Cloneable</tt>.
100: * Otherwise, this method creates a new instance of the class of this
101: * object and initializes all its fields with exactly the contents of
102: * the corresponding fields of this object, as if by assignment; the
103: * contents of the fields are not themselves cloned. Thus, this method
104: * performs a "shallow copy" of this object, not a "deep copy" operation.
105: * <p/>
106: * The class <tt>Object</tt> does not itself implement the interface
107: * <tt>Cloneable</tt>, so calling the <tt>clone</tt> method on an object
108: * whose class is <tt>Object</tt> will result in throwing an
109: * exception at run time.
110: *
111: * @return a clone of this instance.
112: * @throws CloneNotSupportedException if the object's class does not
113: * support the <code>Cloneable</code> interface. Subclasses
114: * that override the <code>clone</code> method can also
115: * throw this exception to indicate that an instance cannot
116: * be cloned.
117: * @see Cloneable
118: */
119: public Object clone() throws CloneNotSupportedException {
120: return super.clone();
121: }
122: }
|