Skip to content

Commit

Permalink
Use Project Lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe committed Apr 1, 2018
1 parent 1ca251f commit 5e8d944
Show file tree
Hide file tree
Showing 94 changed files with 1,026 additions and 6,941 deletions.
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"recommendations": [
"vscjava.vscode-java-pack",
"shengchen.vscode-checkstyle",
"GabrielBB.vscode-lombok",
"naco-siren.gradle-language"
]
}
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ buildscript {
plugins {
id 'java'
id 'maven'
id 'io.franzbecker.gradle-lombok' version '1.11'
id 'checkstyle'
id 'net.saliman.cobertura' version '2.5.2'
id 'com.github.kt3k.coveralls' version '2.8.2'
Expand Down Expand Up @@ -56,6 +57,11 @@ jar {
}
}

lombok {
version = "1.16.20"
sha256 = ""
}

apply from: 'deploy.gradle'

test {
Expand Down
1 change: 1 addition & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.getter.noIsPrefix = true
241 changes: 18 additions & 223 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
import java.util.List;
import java.util.Map;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class Account extends APIResource implements HasId, MetadataStore<Account> {
String id;
String object;
Expand All @@ -33,7 +40,6 @@ public class Account extends APIResource implements HasId, MetadataStore<Account
ExternalAccountCollection externalAccounts;
Keys keys;
LegalEntity legalEntity;
Boolean managed;
Map<String, String> metadata;
Boolean payoutsEnabled;
AccountPayoutSchedule payoutSchedule;
Expand All @@ -50,201 +56,24 @@ public class Account extends APIResource implements HasId, MetadataStore<Account
String type;
Verification verification;

@Deprecated
List<String> currenciesSupported;

public String getId() {
return id;
}

public String getObject() {
return object;
}

public void setObject(String object) {
this.object = object;
}

public String getBusinessLogo() {
return businessLogo;
}

public String getBusinessName() {
return businessName;
}

public String getBusinessPrimaryColor() {
return businessPrimaryColor;
}

public void setBusinessPrimaryColor(String businessPrimaryColor) {
this.businessPrimaryColor = businessPrimaryColor;
}

public String getBusinessURL() {
return businessURL;
}

public Boolean getChargesEnabled() {
return chargesEnabled;
}

public String getCountry() {
return country;
}

public Boolean getDebitNegativeBalances() {
return debitNegativeBalances;
}

public void setDebitNegativeBalances(Boolean debitNegativeBalances) {
this.debitNegativeBalances = debitNegativeBalances;
}

public AccountDeclineChargeOn getDeclineChargeOn() {
return declineChargeOn;
}

public void setDeclineChargeOn(AccountDeclineChargeOn declineChargeOn) {
this.declineChargeOn = declineChargeOn;
}

public String getDefaultCurrency() {
return defaultCurrency;
}

public Boolean getDetailsSubmitted() {
return detailsSubmitted;
}

public String getDisplayName() {
return displayName;
}

public LoginLinkCollection getLoginLinks() {
return loginLinks;
}

public String getEmail() {
return email;
}

public ExternalAccountCollection getExternalAccounts() {
return externalAccounts;
}

public Keys getKeys() {
return keys;
}

public LegalEntity getLegalEntity() {
return legalEntity;
}

/**
* Returns the {@code managed} attribute.
* The {@code managed} attribute.
*
* @return the {@code managed} attribute
* @deprecated Prefer using the {@code type} attribute instead.
* @deprecated Prefer using the {@link #type} attribute instead.
* @see <a href="https://stripe.com/docs/upgrades#2017-05-25">API version 2017-05-25</a>
*/
@Deprecated
public Boolean getManaged() {
return managed;
}

public Map<String, String> getMetadata() {
return metadata;
}

public Boolean getPayoutsEnabled() {
return payoutsEnabled;
}

public void setPayoutsEnabled(Boolean payoutsEnabled) {
this.payoutsEnabled = payoutsEnabled;
}

public AccountPayoutSchedule getPayoutSchedule() {
return payoutSchedule;
}

public void setPayoutSchedule(AccountPayoutSchedule payoutSchedule) {
this.payoutSchedule = payoutSchedule;
}

public String getProductDescription() {
return productDescription;
}

public void setProductDescription(String productDescription) {
this.productDescription = productDescription;
}

public String getStatementDescriptor() {
return statementDescriptor;
}

public String getSupportEmail() {
return supportEmail;
}

public String getSupportPhone() {
return supportPhone;
}

public String getSupportURL() {
return supportURL;
}

public String getTimezone() {
return timezone;
}

public AccountTosAcceptance getTosAcceptance() {
return tosAcceptance;
}

public void setTosAcceptance(AccountTosAcceptance tosAcceptance) {
this.tosAcceptance = tosAcceptance;
}

public AccountTransferSchedule getTransferSchedule() {
return transferSchedule;
}

public void setTransferSchedule(AccountTransferSchedule transferSchedule) {
this.transferSchedule = transferSchedule;
}

public Boolean getTransfersEnabled() {
return transfersEnabled;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public Verification getVerification() {
return verification;
}
Boolean managed;

/**
* Returns the {@code currencies_supported} attribute.
* The {@code currencies_supported} attribute.
*
* @return the {@code currencies_supported} attribute
* @deprecated Prefer using the {@link CountrySpec#getSupportedPaymentCurrencies()} method
* instead.
* @see <a href="https://stripe.com/docs/upgrades#2016-03-07">API version 2016-03-07</a>
*/
@Deprecated
public List<String> getCurrenciesSupported() {
return currenciesSupported;
}
List<String> currenciesSupported;

public static Account create(Map<String, Object> params)
throws AuthenticationException, InvalidRequestException,
Expand Down Expand Up @@ -377,55 +206,21 @@ public Account reject(Map<String, Object> params, RequestOptions options)
instanceURL(Account.class, this.getId())), params, Account.class, options);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Verification extends StripeObject {
Boolean contacted;
String disabledReason;
Long dueBy;
List<String> fieldsNeeded;

public Boolean getContacted() {
return contacted;
}

public String getDisabledReason() {
return disabledReason;
}

public Long getDueBy() {
return dueBy;
}

public List<String> getFieldsNeeded() {
return fieldsNeeded;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

Verification ve = (Verification) o;
return equals(contacted, ve.contacted)
&& equals(disabledReason, ve.disabledReason)
&& equals(dueBy, ve.dueBy)
&& equals(fieldsNeeded, ve.fieldsNeeded);
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Keys extends StripeObject {
String publishable;
String secret;

public String getPublishable() {
return publishable;
}

public String getSecret() {
return secret;
}
}
}
23 changes: 7 additions & 16 deletions src/main/java/com/stripe/model/AccountDeclineChargeOn.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
package com.stripe.model;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class AccountDeclineChargeOn extends StripeObject {
Boolean avsFailure;
Boolean cvcFailure;

public Boolean getAvsFailure() {
return avsFailure;
}

public void setAvsFailure(Boolean avsFailure) {
this.avsFailure = avsFailure;
}

public Boolean getCvcFailure() {
return cvcFailure;
}

public void setCvcFailure(Boolean cvcFailure) {
this.cvcFailure = cvcFailure;
}
}
Loading

0 comments on commit 5e8d944

Please sign in to comment.