Coverage Report - org.codehaus.plexus.metadata.ann.AnnEnum
 
Classes in this File Line Coverage Branch Coverage Complexity
AnnEnum
0 %
0/26
0 %
0/18
3,667
 
 1  
 /*
 2  
  * Copyright (C) 2008 the original author or authors.
 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  
 
 17  
 package org.codehaus.plexus.metadata.ann;
 18  
 
 19  
 import org.objectweb.asm.Type;
 20  
 
 21  
 /**
 22  
  * @author Eugene Kuleshov
 23  
  */
 24  
 public class AnnEnum {
 25  
 
 26  
   private final String desc;
 27  
   private final String value;
 28  
 
 29  0
   public AnnEnum(String desc, String value) {
 30  0
     this.desc = desc;
 31  0
     this.value = value;
 32  0
   }
 33  
 
 34  
   public String getDesc() {
 35  0
     return desc;
 36  
   }
 37  
 
 38  
   public String getValue() {
 39  0
     return value;
 40  
   }
 41  
   
 42  
   public String getType() {
 43  0
     return Type.getType(desc).getClassName(); 
 44  
   }
 45  
 
 46  
   public int hashCode() {
 47  0
     return 31 * (31 + desc.hashCode()) + value.hashCode();
 48  
   }
 49  
 
 50  
   public boolean equals(Object obj) {
 51  0
     if (this == obj) {
 52  0
       return true;
 53  
     }
 54  0
     if (obj == null) {
 55  0
       return false;
 56  
     }
 57  0
     if (getClass() != obj.getClass()) {
 58  0
       return false;
 59  
     }
 60  0
     AnnEnum other = (AnnEnum) obj;
 61  0
     if (desc == null) {
 62  0
       if (other.desc != null) {
 63  0
         return false;
 64  
       }
 65  0
     } else if (!desc.equals(other.desc)) {
 66  0
       return false;
 67  
     }
 68  0
     if (value == null) {
 69  0
       if (other.value != null) {
 70  0
         return false;
 71  
       }
 72  0
     } else if (!value.equals(other.value)) {
 73  0
       return false;
 74  
     }
 75  0
     return true;
 76  
   }
 77  
   
 78  
 }