@Override public long getLastReturnTime() { return pooledObject.getLastReturnTime(); }
@Override public String getLastReturnTimeFormatted() { final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); return sdf.format(Long.valueOf(pooledObject.getLastReturnTime())); }
@Override public int compareTo(final PooledObject<T> other) { final long lastActiveDiff = this.getLastReturnTime() - other.getLastReturnTime(); if (lastActiveDiff == 0) { // Make sure the natural ordering is broadly consistent with equals // although this will break down if distinct objects have the same // identity hash code. // see java.lang.Comparable Javadocs return System.identityHashCode(this) - System.identityHashCode(other); } // handle int overflow return (int)Math.min(Math.max(lastActiveDiff, Integer.MIN_VALUE), Integer.MAX_VALUE); }
@Override public long getLastReturnTime() { return pooledObject.getLastReturnTime(); }
@Override public String getLastReturnTimeFormatted() { final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); return sdf.format(Long.valueOf(pooledObject.getLastReturnTime())); }
@Override public int compareTo(final PooledObject<T> other) { final long lastActiveDiff = this.getLastReturnTime() - other.getLastReturnTime(); if (lastActiveDiff == 0) { // Make sure the natural ordering is broadly consistent with equals // although this will break down if distinct objects have the same // identity hash code. // see java.lang.Comparable Javadocs return System.identityHashCode(this) - System.identityHashCode(other); } // handle int overflow return (int)Math.min(Math.max(lastActiveDiff, Integer.MIN_VALUE), Integer.MAX_VALUE); }