Skip to content

Commit

Permalink
fixed javadoc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yallen011 committed Nov 16, 2020
1 parent e6623ff commit 8cc476e
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/vonage/client/auth/AuthCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void add(AuthMethod auth) {
*
* @throws VonageUnacceptableAuthException if no matching AuthMethod is found.
*/
@SuppressWarnings("unchecked")
public <T extends AuthMethod> T getAuth(Class<T> type) throws VonageUnacceptableAuthException {
for (AuthMethod availableAuthMethod : authList) {
if (type.isInstance(availableAuthMethod)) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/vonage/client/auth/RequestSigning.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public static boolean verifyRequestSignature(HttpServletRequest request, String
*
* @param request The HttpServletRequest to be verified.
* @param secretKey The pre-shared secret key used by the sender of the request to create the signature.
* @param hashType Hash type to be used to construct request parameters.
*
* @return true if the signature is correct for this request and secret key.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public String calculate(String input) throws NoSuchAlgorithmException, InvalidKe
* @return hashed representation of the input string
* @throws NoSuchAlgorithmException if the algorithm is not available.
* @throws UnsupportedEncodingException if the encoding type is invalid
* @throws InvalidKeyException Only applicable to HMAC encoding types, when a bad key is provided.
*/
public String calculate(String input, String secretKey, String encoding) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
return calculate(input + secretKey, encoding);
Expand All @@ -44,6 +45,7 @@ public String calculate(String input, String secretKey, String encoding) throws
* @return hashed representation of the input string
* @throws NoSuchAlgorithmException if the algorithm is not available.
* @throws UnsupportedEncodingException if the encoding type is invalid
* @throws InvalidKeyException Only applicable to HMAC encoding types, when a bad key is provided.
*/
public abstract String calculate(String input, String encoding) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static String calculate(String input, HashType hashType) throws NoSuchAlg
* @return representation of the input string with given hash type
* @throws NoSuchAlgorithmException if the algorithm is not available.
* @throws InvalidKeyException Only applicable to HMAC encoding types, when a bad key is provided.
* @throws UnsupportedEncodingException if the specified encoding is unavailable.
*/
public static String calculate(String input, String encoding, HashType hashType) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException {
return hashTypes.get(hashType).calculate(input, encoding);
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/vonage/client/incoming/DtmfResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ public class DtmfResult {

/**
*
* @return
* @return The buttons pressed by the user
*/
public String getDigits() {
return digits;
}

/**
*
* @return Whether the DTMF input timed out: true if it did, false if not
*/
@JsonProperty("timed_out")
public boolean isTimedOut() {
return timedOut;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/vonage/client/numbers/NumbersClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public ListNumbersResponse listNumbers(ListNumbersFilter filter) throws VonageRe
/**
* Search for available Vonage Virtual Numbers.
*
* @param country country to search available numbers from
* @return available Vonage Virtual Numbers
* @throws VonageResponseParseException if the response from the API could not be parsed.
* @throws VonageClientException if an error is returned by the server.
*/
Expand All @@ -78,6 +80,8 @@ public SearchNumbersResponse searchNumbers(String country) throws VonageResponse
/**
* Search for available Vonage Virtual Numbers.
*
* @param filter search for available Vonage Virtual Number with filters
* @return available Vonage Virtual Numbers
* @throws VonageResponseParseException if the response from the API could not be parsed.
* @throws VonageClientException if an error is returned by the server.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public SearchPattern getSearchPattern() {
}

/**
* @param searchPattern
* @param searchPattern The pattern you want to search for. Use the * wildcard to match the start or end of the number.
* For example, *123* matches all numbers that contain the pattern 123.
*/
public void setSearchPattern(SearchPattern searchPattern) {
this.searchPattern = searchPattern;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ public class SearchNumbersResponse {
private AvailableNumber[] numbers = new AvailableNumber[]{};

/**
* Get the number of responses returned by the Vonage API.
* @return the number of responses returned by the Vonage API.
*/
public int getCount() {
return count;
}

/**
* Obtain an array of matching numbers than are available to buy.
* @return list of available numbers
*/
public AvailableNumber[] getNumbers() {
return numbers;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/vonage/client/sms/SmsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class SmsClient {

/**
* Create a new SmsClient.
* @param httpWrapper Http Wrapper used to create a Sms Request
*/
public SmsClient(HttpWrapper httpWrapper) {
message = new SendMessageEndpoint(httpWrapper);
Expand Down Expand Up @@ -80,6 +81,8 @@ public SmsSubmissionResponse submitMessage(Message message) throws VonageRespons
* #searchMessages(String, String...)} instead.
* <p>
*
* @param request request to search for a sms message
* @return sms messages that match the search criteria
* @throws VonageClientException if there was a problem with the Vonage request or response objects.
* @throws VonageResponseParseException if the response from the API could not be parsed.
*/
Expand Down Expand Up @@ -125,6 +128,8 @@ public SearchSmsResponse searchMessages(Date date, String to) throws VonageRespo
* <p>
* You should probably use {@link #searchRejectedMessages(Date, String)} instead.
*
* @param request search for rejected SMS transactions
*
* @return rejection data matching the provided criteria
*
* @throws VonageClientException if there was a problem with the Vonage request or response objects.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/vonage/client/sms/messages/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ protected Message(final MessageType type,
* valid short-code / long code that can be replied to, or a short text description of the application
* sending the message (Max 15 chars)
* @param to the phone number of the handset you wish to send the message to
* @param statusReportRequired flag to enable status updates about the delivery of this message
*/
protected Message(final MessageType type,
final String from,
Expand Down Expand Up @@ -148,7 +149,7 @@ public void setCallbackUrl(String callbackUrl) {
}

/**
* Get the value of the 'status-report-req' parameter.
* @return get the value of the 'status-report-req' parameter.
*/
public boolean getStatusReportRequired() {
return statusReportRequired;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public TextMessage(final String from,
* description of the application sending the message (Max 11 chars)
* @param to the phone number of the handset that you wish to send the message to
* @param messageBody The text of the message to be sent to the handset
* @param unicode set this flag to true if the message needs to be submitted as a unicode message
*/
public TextMessage(final String from,
final String to,
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/vonage/client/verify/Psd2Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ public int getId() {
}

/**
* @param number The recipient's phone number in <a href="https://en.wikipedia.org/wiki/E.164">E.164</a>
* format.
* @param amount The decimal amount of the payment to be confirmed, in Euros.
* @param payee An alphanumeric string to indicate to the user the name of the recipient that they
* are confirming a payment to.
* @return A new Builder to start building.
*/
public static Builder builder(String number, Double amount, String payee) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,11 @@ public void testVerifyWithNonNumericStatus() throws Exception {
+ " \"error_text\": \"error\"\n" + "}"
));

VerifyResponse response = client.verify(new VerifyRequest("447700900999",
"TestBrand",
"15555215554",
6,
Locale.US
));
VerifyResponse response = client.verify(VerifyRequest.builder("447700900999","TestBrand")
.senderId("15555215554")
.length(6)
.locale(Locale.US)
.build());

assertEquals(VerifyStatus.INTERNAL_ERROR, response.getStatus());
assertEquals("error", response.getErrorText());
Expand Down

0 comments on commit 8cc476e

Please sign in to comment.