kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 81b76d1ea0600a326e86d566dc78fb976d172d9d4cbb643a51b53896c4185298 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2014-10-06 16:19 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2014-10-06 16:20 +02:00 |
| Parents | 5f007c700854 |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +16 −3
| @@ -654,15 +654,28 @@ | ||
| 654 | 654 | * to trigger auto-detection (see above) but this is the default (so you don't have |
| 655 | 655 | * to call this method for that behavior). |
| 656 | 656 | * @return this Builder. |
| 657 | - * | |
| 658 | - * @throws IllegalArgumentException if {@code version} is neither 1, 2 or a | |
| 659 | - * negative value. | |
| 660 | 657 | */ |
| 661 | 658 | public Builder withProtocolVersion(ProtocolVersion version) { |
| 662 | 659 | this.protocolVersion = version; |
| 663 | 660 | return this; |
| 664 | 661 | } |
| 665 | 662 | |
| 663 | + /** | |
| 664 | + * The native protocol version to use, as a number. | |
| 665 | + * <p> | |
| 666 | + * This method is provided for backward-compatibility. Whenever possible, | |
| 667 | + * {@link #withProtocolVersion(ProtocolVersion)} should be preferred. | |
| 668 | + * | |
| 669 | + * @param version the native protocol version as a number. | |
| 670 | + * @return this Builder. | |
| 671 | + * @throws DriverInternalError if the number does not correspond to any known native | |
| 672 | + * protocol version. | |
| 673 | + */ | |
| 674 | + public Builder withProtocolVersion(int version) { | |
| 675 | + this.protocolVersion = ProtocolVersion.fromInt(version); | |
| 676 | + return this; | |
| 677 | + } | |
| 678 | + | |
| 666 | 679 | /** |
| 667 | 680 | * Adds a contact point. |
| 668 | 681 | * <p> |