001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.systest.jaxb.model;
019:
020: import javax.xml.bind.annotation.XmlAccessType;
021: import javax.xml.bind.annotation.XmlAccessorType;
022: import javax.xml.bind.annotation.XmlElement;
023: import javax.xml.bind.annotation.XmlRootElement;
024: import javax.xml.bind.annotation.XmlType;
025:
026: import org.apache.commons.lang.builder.EqualsBuilder;
027: import org.apache.commons.lang.builder.ToStringBuilder;
028:
029: @XmlType(name="extendedwidget",namespace="http://cxf.org.apache/model")
030: @XmlRootElement(name="extendedwidget",namespace="http://cxf.org.apache/model")
031: @XmlAccessorType(XmlAccessType.FIELD)
032: public class ExtendedWidget extends Widget {
033:
034: @XmlElement(required=true,namespace="http://cxf.org.apache/model")
035: private boolean extended = true;
036:
037: /**
038: *
039: */
040: public ExtendedWidget() {
041: super ();
042: }
043:
044: /**
045: * @param id
046: * @param name
047: * @param serialNumber
048: * @param broken
049: * @param extended
050: */
051: public ExtendedWidget(long id, String name, String serialNumber,
052: boolean broken, boolean extended) {
053: super (id, name, serialNumber, broken);
054: this .extended = extended;
055: }
056:
057: /**
058: * @return the extended
059: */
060: public boolean isExtended() {
061: return extended;
062: }
063:
064: /**
065: * @param extended the extended to set
066: */
067: public void setExtended(boolean extended) {
068: this .extended = extended;
069: }
070:
071: /*
072: * (non-Javadoc)
073: *
074: * @see java.lang.Object#equals(java.lang.Object)
075: */
076: @Override
077: public boolean equals(Object obj) {
078: boolean ret = false;
079: if (obj instanceof ExtendedWidget) {
080: ExtendedWidget w = (ExtendedWidget) obj;
081: ret = new EqualsBuilder().appendSuper(true).append(
082: extended, w.extended).isEquals();
083: }
084:
085: return ret;
086: }
087:
088: @Override
089: public int hashCode() {
090: return super .hashCode();
091: }
092:
093: /*
094: * (non-Javadoc)
095: *
096: * @see java.lang.Object#toString()
097: */
098: @Override
099: public String toString() {
100: return new ToStringBuilder(this ).appendSuper(super .toString())
101: .append("extended", extended).toString();
102: }
103: }
|