Coverage Report - org.vostokframework.application.cache.CachedAssetData
 
Classes in this File Line Coverage Branch Coverage Complexity
CachedAssetData
59%
13/22
N/A
0
 
 1  
 /*
 2  
  * Licensed under the MIT License
 3  
  * 
 4  
  * Copyright 2011 (c) Flávio Silva, flsilva.com
 5  
  *
 6  
  * Permission is hereby granted, free of charge, to any person
 7  
  * obtaining a copy of this software and associated documentation
 8  
  * files (the "Software"), to deal in the Software without
 9  
  * restriction, including without limitation the rights to use,
 10  
  * copy, modify, merge, publish, distribute, sublicense, and/or sell
 11  
  * copies of the Software, and to permit persons to whom the
 12  
  * Software is furnished to do so, subject to the following
 13  
  * conditions:
 14  
  *
 15  
  * The above copyright notice and this permission notice shall be
 16  
  * included in all copies or substantial portions of the Software.
 17  
  *
 18  
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 19  
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 20  
  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 21  
  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 22  
  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 23  
  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 24  
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 25  
  * OTHER DEALINGS IN THE SOFTWARE.
 26  
  * 
 27  
  * http://www.opensource.org/licenses/mit-license.php
 28  
  */
 29  1
 package org.vostokframework.application.cache
 30  
 {
 31  
         import org.as3utils.StringUtil;
 32  
         import org.vostokframework.VostokIdentification;
 33  
         import org.vostokframework.domain.assets.AssetType;
 34  
 
 35  
         /**
 36  
          * description
 37  
          * 
 38  
          * @author Flávio Silva
 39  
          */
 40  
         public class CachedAssetData
 41  
         {
 42  
                 /**
 43  
                  * @private
 44  
                  */
 45  
                 private var _bytesTotal:int;
 46  
                 private var _data:*;
 47  
                 private var _identification:VostokIdentification;
 48  
                 private var _latency:int;
 49  
                 private var _queueIdentification:VostokIdentification;
 50  
                 private var _src:String;
 51  
                 private var _totalTime:int;
 52  
                 private var _type:AssetType;
 53  
                 
 54  
                 public function get bytesTotal():int { return _bytesTotal; }
 55  
                 
 56  
                 public function set bytesTotal(value:int):void
 57  
                 {
 58  0
                         if (value < 1) throw new ArgumentError("Value must be greater than zero. Received: <" + value + ">");
 59  0
                         _bytesTotal = value;
 60  0
                 }
 61  
                 
 62  
                 public function get data():* { return _data; }
 63  
                 
 64  
                 public function get identification():VostokIdentification { return _identification; }
 65  
                 
 66  
                 public function get latency():int { return _latency; }
 67  
                 
 68  
                 public function set latency(value:int):void
 69  
                 {
 70  0
                         if (value < 1) throw new ArgumentError("Value must be greater than zero. Received: <" + value + ">");
 71  0
                         _latency = value;
 72  0
                 }
 73  
                 
 74  
                 public function get queueIdentification():VostokIdentification { return _queueIdentification; }
 75  
                 
 76  
                 public function get src():String { return _src; }
 77  
                 
 78  
                 public function get totalTime():int { return _totalTime; }
 79  
                 
 80  
                 public function set totalTime(value:int):void
 81  
                 {
 82  0
                         if (value < 1) throw new ArgumentError("Value must be greater than zero. Received: <" + value + ">");
 83  0
                         _totalTime = value;
 84  0
                 }
 85  
                 
 86  
                 public function get type():AssetType { return _type; }
 87  
                 
 88  
                 /**
 89  
                  * description
 90  
                  * 
 91  
                  * @param name
 92  
                  * @param ordinal
 93  
                  */
 94  
                 public function CachedAssetData(identification:VostokIdentification, queueIdentification:VostokIdentification, data:*, type:AssetType, src:String)
 95  1
                 {
 96  1
                         if (!identification) throw new ArgumentError("Argument <identification> must not be null.");
 97  1
                         if (!queueIdentification) throw new ArgumentError("Argument <queueIdentification> must not be null.");
 98  1
                         if (!data) throw new ArgumentError("Argument <data> must not be null.");
 99  1
                         if (!type) throw new ArgumentError("Argument <type> must not be null.");
 100  1
                         if (StringUtil.isBlank(src)) throw new ArgumentError("Argument <src> must not be null nor an empty String.");
 101  
                         
 102  1
                         _identification = identification;
 103  1
                         _queueIdentification = queueIdentification;
 104  1
                         _data = data;
 105  1
                         _type = type;
 106  1
                         _src = src;
 107  1
                 }
 108  
 
 109  
         }
 110  
 
 111  
 }