1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.registry.base;
18
19 /***
20 * Utility object for serializing with Castor a MediaTypeEntry reference
21 *
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 */
25 public class BaseMediaType implements java.io.Serializable
26 {
27
28 private String name;
29
30 /***
31 * Implements the equals operation so that 2 elements are equal if
32 * all their member values are equal.
33 */
34 public boolean equals(Object object)
35 {
36 if (object==null)
37 {
38 return false;
39 }
40
41 BaseMediaType obj = (BaseMediaType)object;
42
43 if (name!=null)
44 {
45 return name.equals(obj.getRef());
46 }
47 else
48 {
49 if (obj.getRef()!=null)
50 {
51 return false;
52 }
53 }
54
55 return true;
56 }
57
58 /*** @return the media type name that is referenced */
59 public String getRef()
60 {
61 return this.name;
62 }
63
64 /*** Sets the media type name referenced by this object
65 * @param name the required media type name
66 */
67 public void setRef( String name )
68 {
69 this.name = name;
70 }
71
72 }