コード例 #1
0
 public ModuleVersionSelector getRequested() {
   ModuleComponentSelector moduleComponentSelector = dependency.getRequested();
   return DefaultModuleVersionSelector.newSelector(
       moduleComponentSelector.getGroup(),
       moduleComponentSelector.getName(),
       moduleComponentSelector.getVersion());
 }
コード例 #2
0
 public DependencyMetaData withRequestedVersion(String requestedVersion) {
   if (requestedVersion.equals(requested.getVersion())) {
     return this;
   }
   ModuleVersionSelector newRequested =
       DefaultModuleVersionSelector.newSelector(
           requested.getGroup(), requested.getName(), requestedVersion);
   ComponentSelector newSelector = DefaultModuleComponentSelector.newSelector(newRequested);
   return copyWithTarget(newSelector, newRequested);
 }
コード例 #3
0
 public UnresolvedDependencyEdge(UnresolvedDependencyResult dependency) {
   this.dependency = dependency;
   ModuleComponentSelector moduleComponentSelector = dependency.getAttempted();
   ModuleVersionSelector attempted =
       DefaultModuleVersionSelector.newSelector(
           moduleComponentSelector.getGroup(),
           moduleComponentSelector.getName(),
           moduleComponentSelector.getVersion());
   actual =
       DefaultModuleVersionIdentifier.newId(
           attempted.getGroup(), attempted.getName(), attempted.getVersion());
 }
コード例 #4
0
 @Override
 public DependencyMetaData withTarget(ComponentSelector target) {
   if (target instanceof ModuleComponentSelector) {
     ModuleComponentSelector moduleTarget = (ModuleComponentSelector) target;
     ModuleVersionSelector requestedVersion =
         DefaultModuleVersionSelector.newSelector(
             moduleTarget.getGroup(), moduleTarget.getModule(), moduleTarget.getVersion());
     return copyWithTarget(moduleTarget, requestedVersion);
   } else if (target instanceof ProjectComponentSelector) {
     return copyWithTarget(target, requested);
   } else {
     throw new AssertionError("Invalid component selector type for substitution: " + target);
   }
 }