private Timestamp plus ( long secondsToAdd , long nanosToAdd ) { if ( ( secondsToAdd | nanosToAdd ) == 0 ) { return this ; } long epochSec = TimeUtils . checkedAdd ( getSeconds ( ) , secondsToAdd ) ; epochSec = TimeUtils . checkedAdd ( epochSec , nanosToAdd / NANOS_PER_SECOND ) ; nanosToAdd = nanosToAdd % NANOS_PER_SECOND ; long nanoAdjustment = getNanos ( ) + nanosToAdd ; // safe int + NANOS_PER_SECOND return ofEpochSecond ( epochSec , nanoAdjustment ) ; }
Returns a Timestamp with the specified duration added .