1package org.apache.archiva.admin.model.beans;
2/*3 * Licensed to the Apache Software Foundation (ASF) under one4 * or more contributor license agreements. See the NOTICE file5 * distributed with this work for additional information6 * regarding copyright ownership. The ASF licenses this file7 * to you under the Apache License, Version 2.0 (the8 * "License"); you may not use this file except in compliance9 * with the License. You may obtain a copy of the License at10 *11 * http://www.apache.org/licenses/LICENSE-2.012 *13 * Unless required by applicable law or agreed to in writing,14 * software distributed under the License is distributed on an15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY16 * KIND, either express or implied. See the License for the17 * specific language governing permissions and limitations18 * under the License.19 */2021import javax.xml.bind.annotation.XmlRootElement;
22import java.io.Serializable;
2324/**25 * Bean to expose Map entries as Json26 *27 * @author Olivier Lamy28 * @since 1.4-M329 */30 @XmlRootElement(name = "propertyEntry")
31publicclassPropertyEntry32implements Serializable, Comparable<PropertyEntry>
33 {
34private String key;
3536private String value;
3738publicPropertyEntry()
39 {
40// no op41 }
4243publicPropertyEntry( String key, String value )
44 {
45this.key = key;
46this.value = value;
47 }
4849public String getKey()
50 {
51return key;
52 }
5354publicvoid setKey( String key )
55 {
56this.key = key;
57 }
5859public String getValue()
60 {
61return value;
62 }
6364publicvoid setValue( String value )
65 {
66this.value = value;
67 }
6869 @Override
70public String toString()
71 {
72final 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( '}' );
77return sb.toString();
78 }
7980 @Override
81publicint compareTo( PropertyEntry o )
82 {
83if (o == null || o.getKey() == null)
84 {
85return 1;
86 }
87returnthis.key.compareTo( o.getKey() );
88 }
89 }