diff options
author | Olivier Lamy <olamy@apache.org> | 2012-12-22 14:50:45 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-12-22 14:50:45 +0000 |
commit | d712e428881957d596100540ac4d2c1d82d9b686 (patch) | |
tree | 607eb061eba58734c71e1a6edcea027884fd905d /archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src | |
parent | 88674f25b47702cbcd785cafc8a613f4d6e1fd99 (diff) | |
download | archiva-d712e428881957d596100540ac4d2c1d82d9b686.tar.gz archiva-d712e428881957d596100540ac4d2c1d82d9b686.zip |
order caches rendering
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1425290 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src')
-rw-r--r-- | archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java index 69ebd13af..2f920d9d3 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java @@ -25,9 +25,9 @@ import java.io.Serializable; * @author Olivier Lamy * @since 1.4-M3 */ -@XmlRootElement( name = "cacheEntry" ) +@XmlRootElement(name = "cacheEntry") public class CacheEntry - implements Serializable + implements Serializable, Comparable { private String key; @@ -108,7 +108,6 @@ public class CacheEntry } /** - * * @return cache size in kb */ public long getInMemorySize() @@ -121,6 +120,39 @@ public class CacheEntry this.inMemorySize = inMemorySize; } + public int compareTo( Object o ) + { + return this.key.compareTo( ( (CacheEntry) o ).key ); + } + + @Override + public boolean equals( Object o ) + { + if ( this == o ) + { + return true; + } + if ( o == null || getClass() != o.getClass() ) + { + return false; + } + + CacheEntry that = (CacheEntry) o; + + if ( !key.equals( that.key ) ) + { + return false; + } + + return true; + } + + @Override + public int hashCode() + { + return key.hashCode(); + } + @Override public String toString() { |