| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 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 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 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 | |
} |