Skip to content

Commit

Permalink
Add NonNull annotations to all String arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Sep 25, 2019
1 parent 0cf167d commit 619753e
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.annotation.StringDef;

import org.json.JSONException;
Expand Down Expand Up @@ -44,7 +45,10 @@ public class PayPalLineItem implements Parcelable {
* @param quantity The quantity of the item.
* @param unitAmount The unit amount.
*/
public PayPalLineItem(@PayPalLineItemKind String kind, String name, String quantity, String unitAmount) {
public PayPalLineItem(@NonNull @PayPalLineItemKind String kind,
@NonNull String name,
@NonNull String quantity,
@NonNull String unitAmount) {
mKind = kind;
mName = name;
mQuantity = quantity;
Expand All @@ -56,7 +60,7 @@ public PayPalLineItem(@PayPalLineItemKind String kind, String name, String quant
*
* @param description The description to display.
*/
public void setDescription(String description) {
public void setDescription(@NonNull String description) {
mDescription = description;
}

Expand All @@ -65,7 +69,7 @@ public void setDescription(String description) {
*
* @param kind The {@link PayPalLineItemKind} kind.
*/
public void setKind(@PayPalLineItemKind String kind) {
public void setKind(@NonNull @PayPalLineItemKind String kind) {
mKind = kind;
}

Expand All @@ -74,7 +78,7 @@ public void setKind(@PayPalLineItemKind String kind) {
*
* @param name The name to display
*/
public void setName(String name) {
public void setName(@NonNull String name) {
mName = name;
}

Expand All @@ -83,7 +87,7 @@ public void setName(String name) {
*
* @param productCode The product code.
*/
public void setProductCode(String productCode) {
public void setProductCode(@NonNull String productCode) {
mProductCode = productCode;
}

Expand All @@ -92,7 +96,7 @@ public void setProductCode(String productCode) {
*
* @param quantity The quantity.
*/
public void setQuantity(String quantity) {
public void setQuantity(@NonNull String quantity) {
mQuantity = quantity;
}

Expand All @@ -101,7 +105,7 @@ public void setQuantity(String quantity) {
*
* @param unitAmount The unit amount.
*/
public void setUnitAmount(String unitAmount) {
public void setUnitAmount(@NonNull String unitAmount) {
mUnitAmount = unitAmount;
}

Expand All @@ -110,7 +114,7 @@ public void setUnitAmount(String unitAmount) {
*
* @param unitTaxAmount The unit tax amount.
*/
public void setUnitTaxAmount(String unitTaxAmount) {
public void setUnitTaxAmount(@NonNull String unitTaxAmount) {
mUnitTaxAmount = unitTaxAmount;
}

Expand All @@ -119,7 +123,7 @@ public void setUnitTaxAmount(String unitTaxAmount) {
*
* @param url The URL with additional information.
*/
public void setUrl(String url) {
public void setUrl(@NonNull String url) {
mUrl = url;
}

Expand Down

0 comments on commit 619753e

Please sign in to comment.