]> source.dussan.org Git - archiva.git/commitdiff
ordering
authorOlivier Lamy <olamy@apache.org>
Tue, 12 Feb 2013 17:12:30 +0000 (17:12 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 12 Feb 2013 17:12:30 +0000 (17:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1445273 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/PropertyEntry.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RedbackRuntimeConfiguration.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRedbackRuntimeConfigurationService.java

index e218d6d25ad2583a0642c3d85361cc8f918738d0..c13bf8fc92b11b55fe30ce7732e839b19f6e22bf 100644 (file)
@@ -27,12 +27,12 @@ import java.io.Serializable;
  * @author Olivier Lamy
  * @since 1.4-M3
  */
-@XmlRootElement( name = "propertyEntry" )
+@XmlRootElement(name = "propertyEntry")
 public class PropertyEntry
-    implements Serializable
+    implements Serializable, Comparable<PropertyEntry>
 {
     private String key;
-    
+
     private String value;
 
     public PropertyEntry()
@@ -76,4 +76,9 @@ public class PropertyEntry
         sb.append( '}' );
         return sb.toString();
     }
+
+    public int compareTo( PropertyEntry o )
+    {
+        return this.key.compareTo( o.getKey() );
+    }
 }
index 95257d681bd7ba94635a7e9ae6ef352f06e3af14..99c8b893bebe3a0ed3afe794138f81becfe86c6b 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.admin.model.beans;
 import javax.xml.bind.annotation.XmlRootElement;
 import java.io.Serializable;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -122,6 +123,7 @@ public class RedbackRuntimeConfiguration
         {
             configurationPropertiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
         }
+        Collections.sort( configurationPropertiesEntries );
         return configurationPropertiesEntries;
     }
 
index e6694dc90a3d7cebf47d7e2e65b4189fab35f57f..a4e9fd304fa577f37a5eb2f1be84b9fdafdea406 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.archiva.rest.services;
  */
 
 import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.beans.PropertyEntry;
 import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
 import org.apache.archiva.admin.model.beans.LdapConfiguration;
 import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
@@ -46,6 +47,7 @@ import javax.naming.InvalidNameException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;