/** * Creates a version range from the specified versions. * * @param leftType Must be either {@link #LEFT_CLOSED} or {@link #LEFT_OPEN} * . * @param leftEndpoint Left endpoint of range. Must not be {@code null}. * @param rightEndpoint Right endpoint of range. May be {@code null} to * indicate the right endpoint is <i>Infinity</i>. * @param rightType Must be either {@link #RIGHT_CLOSED} or * {@link #RIGHT_OPEN}. * @throws IllegalArgumentException If the arguments are invalid. */ public VersionRange(char leftType, Version leftEndpoint, Version rightEndpoint, char rightType) { if ((leftType != LEFT_CLOSED) && (leftType != LEFT_OPEN)) { throw new IllegalArgumentException("invalid leftType \"" + leftType + "\""); } if ((rightType != RIGHT_OPEN) && (rightType != RIGHT_CLOSED)) { throw new IllegalArgumentException("invalid rightType \"" + rightType + "\""); } if (leftEndpoint == null) { throw new IllegalArgumentException("null leftEndpoint argument"); } leftClosed = leftType == LEFT_CLOSED; rightClosed = rightType == RIGHT_CLOSED; left = leftEndpoint; right = rightEndpoint; empty = isEmpty0(); }
left = endpointLeft; right = endpointRight; empty = isEmpty0();