/** * Returns {@code true} if the specified version is a match with this version * or one of its implied versions. Two versions are compatible if they are for * the same service and have matching major and minor version numbers. A * version number is a match if it is the same or one is {@link #ANY}. */ public final boolean matches(Version v) { if (isSameService(v) && (major == v.major || major == ANY || v.major == ANY) && (minor == v.minor || minor == ANY || v.minor == ANY)) { return true; } for (Version impliedVersion : impliedVersions) { if (impliedVersion == this) { continue; } if (impliedVersion.matches(v)) { return true; } } return false; }
/** * Returns {@code true} if the specified version is a match with this version * or one of its implied versions. Two versions are compatible if they are for * the same service and have matching major and minor version numbers. A * version number is a match if it is the same or one is {@link #ANY}. */ public final boolean matches(Version v) { if (isSameService(v) && (major == v.major || major == ANY || v.major == ANY) && (minor == v.minor || minor == ANY || v.minor == ANY)) { return true; } for (Version impliedVersion : impliedVersions) { if (impliedVersion == this) { continue; } if (impliedVersion.matches(v)) { return true; } } return false; }