This project has retired. For details please refer to its Attic page.
PropertyEntry xref
View Javadoc
1   package org.apache.archiva.admin.model.beans;
2   /*
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   */
20  
21  import javax.xml.bind.annotation.XmlRootElement;
22  import java.io.Serializable;
23  
24  /**
25   * Bean to expose Map entries as Json
26   *
27   * @author Olivier Lamy
28   * @since 1.4-M3
29   */
30  @XmlRootElement(name = "propertyEntry")
31  public class PropertyEntry
32      implements Serializable, Comparable<PropertyEntry>
33  {
34      private String key;
35  
36      private String value;
37  
38      public PropertyEntry()
39      {
40          // no op
41      }
42  
43      public PropertyEntry( String key, String value )
44      {
45          this.key = key;
46          this.value = value;
47      }
48  
49      public String getKey()
50      {
51          return key;
52      }
53  
54      public void setKey( String key )
55      {
56          this.key = key;
57      }
58  
59      public String getValue()
60      {
61          return value;
62      }
63  
64      public void setValue( String value )
65      {
66          this.value = value;
67      }
68  
69      @Override
70      public String toString()
71      {
72          final StringBuilder sb = new StringBuilder();
73          sb.append( "PropertyEntry" );
74          sb.append( "{key='" ).append( key ).append( '\'' );
75          sb.append( ", value='" ).append( value ).append( '\'' );
76          sb.append( '}' );
77          return sb.toString();
78      }
79  
80      @Override
81      public int compareTo( PropertyEntry o )
82      {
83          if (o == null || o.getKey() == null)
84          {
85              return 1;
86          }
87          return this.key.compareTo( o.getKey() );
88      }
89  }