Coverage Report - org.dozer.classmap.CopyByReferenceContainer
 
Classes in this File Line Coverage Branch Coverage Complexity
CopyByReferenceContainer
90%
10/11
100%
4/4
1.75
 
 1  
 /**
 2  
  * Copyright 2005-2013 Dozer Project
 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.dozer.classmap;
 17  
 
 18  
 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 19  
 import org.apache.commons.lang3.builder.ToStringStyle;
 20  
 
 21  
 import java.util.ArrayList;
 22  
 import java.util.List;
 23  
 
 24  
 /**
 25  
  * Only intended for internal use.
 26  
  *
 27  
  * @author garsombke.franz
 28  
  * @author sullins.ben
 29  
  * @author tierney.matt
 30  
  */
 31  706
 public class CopyByReferenceContainer {
 32  
 
 33  706
   private List<CopyByReference> copyByReferences = new ArrayList<CopyByReference>();
 34  
 
 35  
   public void add(CopyByReference copyByReference) {
 36  131
     copyByReferences.add(copyByReference);
 37  131
   }
 38  
 
 39  
   public boolean contains(Class type) {
 40  43405
     return contains(type.getName());
 41  
   }
 42  
 
 43  
   public boolean contains(String typeName) {
 44  81931
     for (CopyByReference reference : copyByReferences) {
 45  75172
       if (reference.matches(typeName)) {
 46  259
         return true;
 47  
       }
 48  74913
     }
 49  81672
     return false;
 50  
   }
 51  
 
 52  
   @Override
 53  
   public String toString() {
 54  0
     return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
 55  
   }
 56  
 
 57  
 }