1 11 package org.eclipse.core.internal.dependencies; 12 13 public class Dependency { 14 private int changedMark; 15 private Object requiredObjectId; 16 private IMatchRule matchRule; 17 private boolean optional; 18 private Object resolvedVersionId; 19 private Object userObject; 20 21 public Dependency(Object requiredObjectId, IMatchRule matchRule, boolean optional, Object userObject) { 22 Assert.isNotNull(requiredObjectId); 23 Assert.isNotNull(matchRule); 24 this.requiredObjectId = requiredObjectId; 25 this.matchRule = matchRule; 26 this.optional = optional; 27 this.userObject = userObject; 28 } 29 30 33 public IMatchRule getMatchRule() { 34 return this.matchRule; 35 } 36 37 40 public Object getRequiredObjectId() { 41 return this.requiredObjectId; 42 } 43 44 47 public boolean isOptional() { 48 return this.optional; 49 } 50 51 54 public Object getResolvedVersionId() { 55 return resolvedVersionId; 56 } 57 58 public void resolve(Object resolvedVersionId, int changedMark) { 59 if ((resolvedVersionId == null && this.resolvedVersionId == null) || (resolvedVersionId != null && resolvedVersionId.equals(this.resolvedVersionId))) 60 return; 61 this.resolvedVersionId = resolvedVersionId; 62 this.changedMark = changedMark; 63 } 64 65 public int getChangedMark() { 66 return changedMark; 67 } 68 69 public String toString() { 70 return " -> " + getUserObject() + " (" + getMatchRule() + ")"; } 72 73 public Object getUserObject() { 74 return userObject; 75 } 76 77 } | Popular Tags |