/*
 * Copyright 2009-2010 Roger Kapsi
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ardverk.dht.storage;

import java.util.concurrent.TimeUnit;

/**
 * An abstract implementation of {@link ValueTuple}.
 */
abstract class AbstractValueTuple implements ValueTuple {

    private final long creationTime = System.currentTimeMillis();
    
    @Override
    public long getCreationTime() {
        return creationTime;
    }
    
    @Override
    public long getAge(TimeUnit unit) {
        long time = System.currentTimeMillis() - creationTime;
        return unit.convert(time, TimeUnit.MILLISECONDS);
    }

    @Override
    public long getAgeInMillis() {
        return getAge(TimeUnit.MILLISECONDS);
    }

    @Override
    public boolean isEmpty() {
        return size() == 0;
    }
}
@@ -666,16 +666,52 @@
 eUnit;%0A%0A
+import org.ardverk.lang.TimeStamp;%0A%0A
 /**%0A * A
@@ -840,20 +840,25 @@
 e final 
-long
+TimeStamp
  creatio
@@ -869,32 +869,21 @@
 e = 
-System.currentTimeMillis
+TimeStamp.now
 ();%0A
@@ -960,24 +960,42 @@
 creationTime
+.getCreationTime()
 ;%0A    %7D%0A    
@@ -1061,118 +1061,39 @@
     
-long time = System.currentTimeMillis() - creationTime;%0A        return unit.convert(time, TimeUnit.MILLISECONDS
+return creationTime.getAge(unit
 );%0A 
@@ -1166,36 +1166,36 @@
 urn 
-getAge(TimeUnit.MILLISECONDS
+creationTime.getAgeInMillis(
 );%0A 

Use TimeStamp