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 Mar 23, 2018
1 parent af363ff commit a41a2f8
Show file tree
Hide file tree
Showing 91 changed files with 642 additions and 6,648 deletions.
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"vscjava.vscode-java-pack",
"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.12'
id 'net.saliman.cobertura' version '2.5.2'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'osgi'
Expand Down Expand Up @@ -58,6 +59,11 @@ jar {
}
}

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

apply from: 'deploy.gradle'

test {
Expand Down
239 changes: 13 additions & 226 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package com.stripe.model;

import java.util.List;
import java.util.Map;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.*;
import com.stripe.net.APIResource;
import com.stripe.net.RequestOptions;

import com.google.gson.annotations.SerializedName;

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

import java.util.List;
import java.util.Map;

@Getter @Setter @EqualsAndHashCode(callSuper=false)
public class Account extends APIResource implements HasId, MetadataStore<Account> {
String id;
String object;
Expand Down Expand Up @@ -45,192 +51,11 @@ 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;
}

/**
* @deprecated Use getType() instead.
*/
@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;
}

/**
* @deprecated Use the country_specs endpoint (https://stripe.com/docs/upgrades#2016-03-07)
*/
@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 @@ -365,55 +190,17 @@ 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;
}
}
}
21 changes: 5 additions & 16 deletions src/main/java/com/stripe/model/AccountDeclineChargeOn.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
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;
}
}
53 changes: 5 additions & 48 deletions src/main/java/com/stripe/model/AccountPayoutSchedule.java
Original file line number Diff line number Diff line change
@@ -1,56 +1,13 @@
package com.stripe.model;

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

@Getter @Setter @EqualsAndHashCode(callSuper=false)
public class AccountPayoutSchedule extends StripeObject {
Integer delayDays;
String interval;
Integer monthlyAnchor;
String weeklyAnchor;

public Integer getDelayDays() {
return delayDays;
}

public void setDelayDays(Integer delayDays) {
this.delayDays = delayDays;
}

public String getInterval() {
return interval;
}

public void setInterval(String interval) {
this.interval = interval;
}

public Integer getMonthlyAnchor() {
return monthlyAnchor;
}

public void setMonthlyAnchor(Integer monthlyAnchor) {
this.monthlyAnchor = monthlyAnchor;
}

public String getWeeklyAnchor() {
return weeklyAnchor;
}

public void setWeeklyAnchor(String weeklyAnchor) {
this.weeklyAnchor = weeklyAnchor;
}

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

AccountPayoutSchedule schedule = (AccountPayoutSchedule) o;
return equals(delayDays, schedule.delayDays) &&
equals(interval, schedule.interval) &&
equals(monthlyAnchor, schedule.monthlyAnchor) &&
equals(weeklyAnchor, schedule.weeklyAnchor);
}
}
Loading

0 comments on commit a41a2f8

Please sign in to comment.