| 1 | package fr.sii.ogham.core.resource.path; | |
| 2 | ||
| 3 | import fr.sii.ogham.core.util.EqualsBuilder; | |
| 4 | import fr.sii.ogham.core.util.HashCodeBuilder; | |
| 5 | ||
| 6 | /** | |
| 7 | * Provides a link between a resource path, its recognized lookup and its | |
| 8 | * resolved value. | |
| 9 | * | |
| 10 | * @author Cyril Dejonghe | |
| 11 | * | |
| 12 | */ | |
| 13 | public class ResolvedResourcePath implements ResolvedPath { | |
| 14 | /** | |
| 15 | * The entire path of the resource, OGHAM style, lookup included. | |
| 16 | */ | |
| 17 | private final ResourcePath originalPath; | |
| 18 | ||
| 19 | /** | |
| 20 | * The lookup corresponding to the resource type / protocol.. | |
| 21 | */ | |
| 22 | private final String lookup; | |
| 23 | ||
| 24 | /** | |
| 25 | * The resolved path of the resource. Used by the resolver. | |
| 26 | */ | |
| 27 | private final String resolvedPath; | |
| 28 | ||
| 29 | public ResolvedResourcePath(ResourcePath originalPath, String lookup, String resolvedPath) { | |
| 30 | super(); | |
| 31 | this.originalPath = originalPath; | |
| 32 | this.lookup = lookup; | |
| 33 | this.resolvedPath = resolvedPath; | |
| 34 | } | |
| 35 | ||
| 36 | public String getOriginalPath() { | |
| 37 |
4
1. getOriginalPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getOriginalPath → SURVIVED 2. getOriginalPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getOriginalPath → NO_COVERAGE 3. getOriginalPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getOriginalPath → TIMED_OUT 4. getOriginalPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getOriginalPath → KILLED |
return originalPath.getOriginalPath(); |
| 38 | } | |
| 39 | ||
| 40 | public String getLookup() { | |
| 41 |
2
1. getLookup : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getLookup → NO_COVERAGE 2. getLookup : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getLookup → SURVIVED |
return lookup; |
| 42 | } | |
| 43 | ||
| 44 | public String getResolvedPath() { | |
| 45 |
7
1. getResolvedPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getResolvedPath → NO_COVERAGE 2. getResolvedPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getResolvedPath → TIMED_OUT 3. getResolvedPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getResolvedPath → KILLED 4. getResolvedPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getResolvedPath → KILLED 5. getResolvedPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getResolvedPath → KILLED 6. getResolvedPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getResolvedPath → KILLED 7. getResolvedPath : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::getResolvedPath → KILLED |
return resolvedPath; |
| 46 | } | |
| 47 | ||
| 48 | ||
| 49 | @Override | |
| 50 | public int hashCode() { | |
| 51 |
1
1. hashCode : replaced int return with 0 for fr/sii/ogham/core/resource/path/ResolvedResourcePath::hashCode → NO_COVERAGE |
return new HashCodeBuilder().append(originalPath, lookup, resolvedPath).hashCode(); |
| 52 | } | |
| 53 | ||
| 54 | @Override | |
| 55 | public boolean equals(Object obj) { | |
| 56 |
4
1. equals : replaced boolean return with false for fr/sii/ogham/core/resource/path/ResolvedResourcePath::equals → NO_COVERAGE 2. equals : replaced boolean return with true for fr/sii/ogham/core/resource/path/ResolvedResourcePath::equals → NO_COVERAGE 3. equals : replaced boolean return with false for fr/sii/ogham/core/resource/path/ResolvedResourcePath::equals → KILLED 4. equals : replaced boolean return with true for fr/sii/ogham/core/resource/path/ResolvedResourcePath::equals → KILLED |
return new EqualsBuilder(this, obj).appendFields("originalPath", "lookup", "resolvedPath").isEqual(); |
| 57 | } | |
| 58 | | |
| 59 | ||
| 60 | @Override | |
| 61 | public String toString() { | |
| 62 | StringBuilder builder = new StringBuilder(); | |
| 63 | builder.append("'").append(resolvedPath).append("' (resolved from ").append(originalPath).append(")"); | |
| 64 |
3
1. toString : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::toString → SURVIVED 2. toString : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::toString → NO_COVERAGE 3. toString : replaced return value with "" for fr/sii/ogham/core/resource/path/ResolvedResourcePath::toString → TIMED_OUT |
return builder.toString(); |
| 65 | } | |
| 66 | } | |
Mutations | ||
| 37 |
1.1 2.2 3.3 4.4 |
|
| 41 |
1.1 2.2 |
|
| 45 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 |
|
| 51 |
1.1 |
|
| 56 |
1.1 2.2 3.3 4.4 |
|
| 64 |
1.1 2.2 3.3 |