1/*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 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 at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * 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 and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.om.registry.base;
1819/***20 * Utility object for serializing with Castor a MediaTypeEntry reference21 *22 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>23 * @version $Id: BaseMediaType.java,v 1.3 2004/02/23 03:08:26 jford Exp $24 */25publicclassBaseMediaType implements java.io.Serializable
26 {
2728private String name;
2930/***31 * Implements the equals operation so that 2 elements are equal if32 * all their member values are equal.33 */34publicboolean equals(Object object)
35 {
36if (object==null)
37 {
38return false;
39 }
4041BaseMediaType obj = (BaseMediaType)object;
4243if (name!=null)
44 {
45return name.equals(obj.getRef());
46 }
47else48 {
49if (obj.getRef()!=null)
50 {
51return false;
52 }
53 }
5455returntrue;
56 }
5758/*** @return the media type name that is referenced */59public String getRef()
60 {
61returnthis.name;
62 }
6364/*** Sets the media type name referenced by this object65 * @param name the required media type name66 */67publicvoid setRef( String name )
68 {
69this.name = name;
70 }
7172 }