1   package com.trendmicro.grid.acl.metadata;
2   
3   import javax.xml.bind.annotation.XmlAccessType;
4   import javax.xml.bind.annotation.XmlAccessorType;
5   import javax.xml.bind.annotation.XmlType;
6   import javax.xml.bind.annotation.XmlValue;
7   
8   /**
9    * Implements a type for the string array handling.
10   *
11   * @author Juergen_Kellerer, 2010-04-19
12   * @version 1.0
13   */
14  @XmlAccessorType(XmlAccessType.FIELD)
15  @XmlType(name = "stringValue", namespace = Metadata.NS)
16  public class StringValue {
17  
18  	@XmlValue
19  	private String content;
20  
21  	/**
22  	 * Constructor for deserialization, don't use directly.
23  	 */
24  	public StringValue() {
25  	}
26  
27  	/**
28  	 * Constructs a new StringValue instance containing the given content.
29  	 *
30  	 * @param content The content to include.
31  	 */
32  	StringValue(String content) {
33  		this.content = content;
34  	}
35  
36  	public String getContent() {
37  		return content;
38  	}
39  
40  	/**
41  	 * {@inheritDoc}
42  	 */
43  	@Override
44  	public boolean equals(Object o) {
45  		if (this == o) return true;
46  		if (!(o instanceof StringValue)) return false;
47  		StringValue that = (StringValue) o;
48  		return !(content != null ? !content.equals(that.content) : that.content != null);
49  	}
50  
51  	/**
52  	 * {@inheritDoc}
53  	 */
54  	@Override
55  	public int hashCode() {
56  		return content != null ? content.hashCode() : 0;
57  	}
58  }