001/**
002 * Copyright 2010-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.common.util.channel.model;
017
018import org.kuali.common.util.Assert;
019
020public final class CopyResult {
021
022        public CopyResult(long startMillis, long transferAmountInBytes, CopyDirection direction) {
023                this.stopMillis = System.currentTimeMillis();
024                Assert.isTrue(stopMillis >= startMillis);
025                Assert.positive(startMillis);
026                Assert.notNegative(transferAmountInBytes);
027                Assert.noNulls(direction);
028                this.startMillis = startMillis;
029                this.amountInBytes = transferAmountInBytes;
030                this.elapsedMillis = stopMillis - startMillis;
031                this.direction = direction;
032        }
033
034        private final long startMillis;
035        private final long stopMillis;
036        private final long elapsedMillis;
037        private final long amountInBytes;
038        private final CopyDirection direction;
039
040        public long getStartMillis() {
041                return startMillis;
042        }
043
044        public long getStopMillis() {
045                return stopMillis;
046        }
047
048        public long getElapsedMillis() {
049                return elapsedMillis;
050        }
051
052        public long getAmountInBytes() {
053                return amountInBytes;
054        }
055
056        public CopyDirection getDirection() {
057                return direction;
058        }
059
060}