Coverage report

  %line %branch
org.apache.jetspeed.util.JetspeedLongObjectID
0% 
0% 

 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
  * contributor license agreements.  See the NOTICE file distributed with
 4  
  * this work for additional information regarding copyright ownership.
 5  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 6  
  * (the "License"); you may not use this file except in compliance with
 7  
  * the License.  You may obtain a copy of the License at
 8  
  * 
 9  
  *      http://www.apache.org/licenses/LICENSE-2.0
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.apache.jetspeed.util;
 18  
 
 19  
 import java.io.Serializable;
 20  
 
 21  
 /**
 22  
  * JetspeedLongObjectID
 23  
  *
 24  
  * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
 25  
  * @version $Id$
 26  
  */
 27  
 public class JetspeedLongObjectID implements PortalObjectID, Serializable
 28  
 {
 29  
     private Long oid;
 30  
     
 31  
     public JetspeedLongObjectID(long oid)
 32  0
     {
 33  0
         this.oid = new Long(oid);
 34  0
     }
 35  
 
 36  
     public JetspeedLongObjectID(Long oid)
 37  0
     {
 38  0
         this.oid = oid;
 39  0
         if ( oid == null )
 40  
         {
 41  
             // really cannot have a null here
 42  0
             throw new NullPointerException();
 43  
         }
 44  0
     }
 45  
 
 46  
     public long getOID()
 47  
     {
 48  0
         return oid.longValue();
 49  
     }
 50  
     
 51  
     public Long getLong()
 52  
     {
 53  0
         return oid;
 54  
     }
 55  
     
 56  
     public boolean equals(Object object)
 57  
     {
 58  0
         if (object instanceof PortalObjectID)
 59  
         {
 60  0
             return ((PortalObjectID)object).getOID() == oid.longValue();
 61  
         }
 62  0
         else if (object instanceof Long)
 63  
         {
 64  0
             return ((Long)object).longValue() == oid.longValue();
 65  
         }
 66  0
         else if (object instanceof Integer)
 67  
         {
 68  0
             return ((Integer)object).longValue() == oid.longValue();
 69  
         }
 70  0
         return false;
 71  
     }
 72  
 
 73  
     public int hashCode()
 74  
     {
 75  0
         return oid.hashCode();
 76  
     }
 77  
     
 78  
     public String toString()
 79  
     {
 80  0
         return oid.toString();
 81  
     }
 82  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.