Coverage Report - org.apache.creadur.whisker.app.analysis.ResourceDescription
 
Classes in this File Line Coverage Branch Coverage Complexity
ResourceDescription
0%
0/36
0%
0/24
3.714
 
 1  
 /**
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  *  to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  *  with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *   http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing,
 13  
  * software distributed under the License is distributed on an
 14  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  * KIND, either express or implied.  See the License for the
 16  
  * specific language governing permissions and limitations
 17  
  * under the License. 
 18  
  */
 19  
 package org.apache.creadur.whisker.app.analysis;
 20  
 
 21  0
 public class ResourceDescription implements Comparable<ResourceDescription> {
 22  
     private final String directory;
 23  
     private final String resource;
 24  
     
 25  
     /**
 26  
      * @param directoryName
 27  
      * @param resourceName
 28  
      */
 29  
     public ResourceDescription(String directoryName, String resourceName) {
 30  0
         super();
 31  0
         this.directory = directoryName;
 32  0
         this.resource = resourceName;
 33  0
     }
 34  
 
 35  
     /**
 36  
      * @return the directoryName
 37  
      */
 38  
     public String getDirectory() {
 39  0
         return directory;
 40  
     }
 41  
 
 42  
     /**
 43  
      * @return the resourceName
 44  
      */
 45  
     public String getResource() {
 46  0
         return resource;
 47  
     }
 48  
 
 49  
     /**
 50  
      * @see java.lang.Object#hashCode()
 51  
      */
 52  
     @Override
 53  
     public int hashCode() {
 54  0
         final int prime = 31;
 55  0
         int result = 1;
 56  0
         result = prime * result
 57  
                 + ((directory == null) ? 0 : directory.hashCode());
 58  0
         result = prime * result
 59  
                 + ((resource == null) ? 0 : resource.hashCode());
 60  0
         return result;
 61  
     }
 62  
 
 63  
     /**
 64  
      * @see java.lang.Object#equals(java.lang.Object)
 65  
      */
 66  
     @Override
 67  
     public boolean equals(Object obj) {
 68  0
         if (this == obj)
 69  0
             return true;
 70  0
         if (obj == null)
 71  0
             return false;
 72  0
         if (getClass() != obj.getClass())
 73  0
             return false;
 74  0
         ResourceDescription other = (ResourceDescription) obj;
 75  0
         if (directory == null) {
 76  0
             if (other.directory != null)
 77  0
                 return false;
 78  0
         } else if (!directory.equals(other.directory))
 79  0
             return false;
 80  0
         if (resource == null) {
 81  0
             if (other.resource != null)
 82  0
                 return false;
 83  0
         } else if (!resource.equals(other.resource))
 84  0
             return false;
 85  0
         return true;
 86  
     }
 87  
 
 88  
     /**
 89  
      * @see java.lang.Object#toString()
 90  
      */
 91  
     @Override
 92  
     public String toString() {
 93  0
         return "ResourceMissingLicense [directoryName=" + directory
 94  
                 + ", resourceName=" + resource + "]";
 95  
     }
 96  
 
 97  
     /**
 98  
      * @see java.lang.Comparable#compareTo(java.lang.Object)
 99  
      */
 100  
     public int compareTo(ResourceDescription other) {
 101  
         final int result;
 102  0
         final int compareOnDirectoryName = this.getDirectory().compareTo(other.getDirectory());
 103  0
         if (compareOnDirectoryName == 0) {
 104  0
             result = this.getResource().compareTo(other.getResource());
 105  
         } else {
 106  0
             result = compareOnDirectoryName;
 107  
         }
 108  0
         return result;
 109  
     }
 110  
     
 111  
     
 112  
 }