Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SP-737 Type Review: Java #260

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@
<artifactId>jackson-databind</artifactId>
<version>2.14.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/com/bitpay/sdk/model/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public class Token {
private String guid;
private String id;
private String pairingCode;
private long pairingExpiration;
private Long pairingExpiration;
private String facade;
private String label;
private int count = 0;
private Integer count = 0;
private List<Policy> policies;
private String resource;
private String value;
private long dateCreated;
private Long dateCreated;

/**
* Instantiates a new Token.
Expand Down Expand Up @@ -163,7 +163,7 @@ public void setLabel(String label) {
*/
@JsonProperty("count")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public int getCount() {
public Integer getCount() {
return this.count;
}

Expand All @@ -173,7 +173,7 @@ public int getCount() {
* @param count the count
*/
@JsonProperty("count")
public void setCount(int count) {
public void setCount(Integer count) {
this.count = count;
}

Expand All @@ -186,7 +186,7 @@ public void setCount(int count) {
* @return the pairing expiration
*/
@JsonIgnore
public long getPairingExpiration() {
public Long getPairingExpiration() {
return this.pairingExpiration;
}

Expand All @@ -196,7 +196,7 @@ public long getPairingExpiration() {
* @param pairingExpiration the pairing expiration
*/
@JsonProperty("pairingExpiration")
public void setPairingExpiration(long pairingExpiration) {
public void setPairingExpiration(Long pairingExpiration) {
this.pairingExpiration = pairingExpiration;
}

Expand Down Expand Up @@ -266,7 +266,7 @@ public void setValue(String value) {
* @return the date created
*/
@JsonIgnore
public long getDateCreated() {
public Long getDateCreated() {
return this.dateCreated;
}

Expand All @@ -276,7 +276,7 @@ public long getDateCreated() {
* @param dateCreated the date created
*/
@JsonProperty("dateCreated")
public void setDateCreated(long dateCreated) {
public void setDateCreated(Long dateCreated) {
this.dateCreated = dateCreated;
}

Expand Down
13 changes: 7 additions & 6 deletions src/main/java/com/bitpay/sdk/model/bill/Bill.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.ZonedDateTime;
import java.util.List;

/**
Expand All @@ -39,10 +40,10 @@ public class Bill {
private List<String> cc;
private String phone = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String dueDate = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private boolean passProcessingFee;
private Boolean passProcessingFee;
private String status = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String url = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String createdDate = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private ZonedDateTime createdDate;
private String id = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String merchant = ModelConfiguration.DEFAULT_NON_SENT_VALUE;

Expand Down Expand Up @@ -415,7 +416,7 @@ public void setDueDate(final String dueDate) {
*/
@JsonProperty("passProcessingFee")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public boolean getPassProcessingFee() {
public Boolean getPassProcessingFee() {
return this.passProcessingFee;
}

Expand All @@ -425,7 +426,7 @@ public boolean getPassProcessingFee() {
* @param passProcessingFee the pass processing fee
*/
@JsonProperty("passProcessingFee")
public void setPassProcessingFee(final boolean passProcessingFee) {
public void setPassProcessingFee(final Boolean passProcessingFee) {
this.passProcessingFee = passProcessingFee;
}

Expand Down Expand Up @@ -479,7 +480,7 @@ public void setUrl(final String url) {
*/
@JsonIgnore
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public String getCreatedDate() {
public ZonedDateTime getCreatedDate() {
return this.createdDate;
}

Expand All @@ -489,7 +490,7 @@ public String getCreatedDate() {
* @param createdDate the create date
*/
@JsonProperty("createdDate")
public void setCreatedDate(final String createdDate) {
public void setCreatedDate(final ZonedDateTime createdDate) {
this.createdDate = createdDate;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/bitpay/sdk/model/invoice/Buyer.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Buyer {
private String country = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String email = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String phone = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private boolean notify;
private Boolean notify;

/**
* Instantiates a new Buyer.
Expand Down Expand Up @@ -234,7 +234,7 @@ public void setPhone(String phone) {
*/
@JsonProperty("notify")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public boolean getNotify() {
public Boolean getNotify() {
return this.notify;
}

Expand All @@ -245,7 +245,7 @@ public boolean getNotify() {
* @param notify the notify
*/
@JsonProperty("notify")
public void setNotify(boolean notify) {
public void setNotify(Boolean notify) {
this.notify = notify;
}

Expand Down
108 changes: 108 additions & 0 deletions src/main/java/com/bitpay/sdk/model/invoice/BuyerFields.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* Copyright (c) 2019 BitPay.
* All rights reserved.
*/

package com.bitpay.sdk.model.invoice;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Buyer Fields.
*
* @see <a href="https://developer.bitpay.com/reference/notifications-invoices">Invoice Webhook</a>
*/
@JsonIgnoreProperties(ignoreUnknown = true)
class BuyerFields {

protected String buyerName;
protected String buyerAddress1;
protected String buyerAddress2;
protected String buyerCity;
protected String buyerState;
protected String buyerZip;
protected String buyerCountry;
protected String buyerPhone;
protected Boolean buyerNotify;
protected String buyerEmail;

public String getBuyerName() {
return this.buyerName;
}

public void setBuyerName(String buyerName) {
this.buyerName = buyerName;
}

public String getBuyerAddress1() {
return this.buyerAddress1;
}

public void setBuyerAddress1(String buyerAddress1) {
this.buyerAddress1 = buyerAddress1;
}

public String getBuyerAddress2() {
return this.buyerAddress2;
}

public void setBuyerAddress2(String buyerAddress2) {
this.buyerAddress2 = buyerAddress2;
}

public String getBuyerCity() {
return this.buyerCity;
}

public void setBuyerCity(String buyerCity) {
this.buyerCity = buyerCity;
}

public String getBuyerState() {
return this.buyerState;
}

public void setBuyerState(String buyerState) {
this.buyerState = buyerState;
}

public String getBuyerZip() {
return this.buyerZip;
}

public void setBuyerZip(String buyerZip) {
this.buyerZip = buyerZip;
}

public String getBuyerCountry() {
return this.buyerCountry;
}

public void setBuyerCountry(String buyerCountry) {
this.buyerCountry = buyerCountry;
}

public String getBuyerPhone() {
return this.buyerPhone;
}

public void setBuyerPhone(String buyerPhone) {
this.buyerPhone = buyerPhone;
}

public Boolean getBuyerNotify() {
return this.buyerNotify;
}

public void setBuyerNotify(Boolean buyerNotify) {
this.buyerNotify = buyerNotify;
}

public String getBuyerEmail() {
return this.buyerEmail;
}

public void setBuyerEmail(String buyerEmail) {
this.buyerEmail = buyerEmail;
}
}
Loading