mirror of https://github.com/apache/archiva.git
order caches rendering
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1425290 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
88674f25b4
commit
d712e42888
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -134,6 +134,8 @@ public class DefaultSystemStatusService
|
|||
cacheStatistics.getInMemorySize() ) );
|
||||
}
|
||||
|
||||
Collections.sort( cacheEntries );
|
||||
|
||||
return cacheEntries;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue