Coverage Report - org.apache.commons.cache.remote.StoreRequest
 
Classes in this File Line Coverage Branch Coverage Complexity
StoreRequest
0%
0/23
0%
0/34
1
 
 1  
 /*
 2  
  * Copyright 2001-2004 The Apache Software Foundation
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.apache.commons.cache.remote;
 17  
 
 18  
 import java.io.Serializable;
 19  
 
 20  
 /**
 21  
  * tk.
 22  
  *
 23  
  * @version $Id: StoreRequest.java 155435 2005-02-26 13:17:27Z dirkv $
 24  
  * @author Rodney Waldhoff
 25  
  */
 26  
 public class StoreRequest implements CacheRequest {
 27  0
   protected Serializable _key = null;
 28  0
   protected Serializable _val = null;
 29  0
   protected Serializable _group = null;
 30  0
   protected Long _expiry = null;
 31  0
   protected Long _cost = null;
 32  
 
 33  
   public StoreRequest(Serializable key, Serializable val, Long expiry) {
 34  0
     this(key,val,expiry,(Long)null,(Serializable)null);
 35  0
   }
 36  
 
 37  
   public StoreRequest(Serializable key, Serializable val, Long expiry, Long cost) {
 38  0
     this(key,val,expiry,cost,(Serializable)null);
 39  0
   }
 40  
 
 41  0
   public StoreRequest(Serializable key, Serializable val, Long expiry, Long cost, Serializable group) {
 42  0
     _key = key;
 43  0
     _val = val;
 44  0
     _expiry = expiry;
 45  0
     _cost = cost;
 46  0
     _group = group;
 47  0
   }
 48  
 
 49  
   public Serializable getKey() {
 50  0
     return _key;
 51  
   }
 52  
 
 53  
   public Serializable getValue() {
 54  0
     return _val;
 55  
   }
 56  
 
 57  
   public Serializable getGroup() {
 58  0
     return _group;
 59  
   }
 60  
 
 61  
   public Long getExpiresAt() {
 62  0
     return _expiry;
 63  
   }
 64  
 
 65  
   public Long getCost() {
 66  0
     return _cost;
 67  
   }
 68  
 
 69  
   public boolean equals(StoreRequest req) {
 70  0
     return ( (null != req)
 71  
              && (null == req.getKey()       ? null == _key    : _key.equals(req.getKey()))
 72  
              && (null == req.getGroup()     ? null == _group  : _group.equals(req.getGroup()))
 73  
              && (null == req.getExpiresAt() ? null == _expiry : _expiry.equals(req.getExpiresAt()))
 74  
              && (null == req.getCost()      ? null == _cost   : _cost.equals(req.getCost()))
 75  
              && (null == req.getValue()     ? null == _val    : _val.equals(req.getValue()))
 76  
            );
 77  
   }
 78  
 
 79  
   public int hashCode() {
 80  0
     return (null == _key ? -1 : _key.hashCode());
 81  
   }
 82  
 }