
com.ning.billing.client.model.Subscription Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of killbill-client-java Show documentation
Show all versions of killbill-client-java Show documentation
Kill Bill Java client library
The newest version!
/*
* Copyright 2010-2014 Ning, Inc.
*
* Ning licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.ning.billing.client.model;
import java.util.List;
import java.util.UUID;
import javax.annotation.Nullable;
import org.joda.time.LocalDate;
import com.ning.billing.catalog.api.BillingPeriod;
import com.ning.billing.catalog.api.ProductCategory;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Subscription extends KillBillObject {
private UUID accountId;
private UUID bundleId;
private UUID subscriptionId;
private String externalKey;
private LocalDate startDate;
private String productName;
private ProductCategory productCategory;
private BillingPeriod billingPeriod;
private String priceList;
private LocalDate cancelledDate;
private LocalDate chargedThroughDate;
private LocalDate billingStartDate;
private LocalDate billingEndDate;
private List events;
private List deletedEvents;
private List newEvents;
public Subscription() { }
@JsonCreator
public Subscription(@JsonProperty("accountId") @Nullable final UUID accountId,
@JsonProperty("bundleId") @Nullable final UUID bundleId,
@JsonProperty("subscriptionId") @Nullable final UUID subscriptionId,
@JsonProperty("externalKey") @Nullable final String externalKey,
@JsonProperty("startDate") @Nullable final LocalDate startDate,
@JsonProperty("productName") @Nullable final String productName,
@JsonProperty("productCategory") @Nullable final ProductCategory productCategory,
@JsonProperty("billingPeriod") @Nullable final BillingPeriod billingPeriod,
@JsonProperty("priceList") @Nullable final String priceList,
@JsonProperty("cancelledDate") @Nullable final LocalDate cancelledDate,
@JsonProperty("chargedThroughDate") @Nullable final LocalDate chargedThroughDate,
@JsonProperty("billingStartDate") @Nullable final LocalDate billingStartDate,
@JsonProperty("billingEndDate") @Nullable final LocalDate billingEndDate,
@JsonProperty("events") @Nullable final List events,
@JsonProperty("newEvents") @Nullable final List newEvents,
@JsonProperty("deletedEvents") @Nullable final List deletedEvents,
@JsonProperty("auditLogs") @Nullable final List auditLogs) {
super(auditLogs);
this.startDate = startDate;
this.productName = productName;
this.productCategory = productCategory;
this.billingPeriod = billingPeriod;
this.priceList = priceList;
this.cancelledDate = cancelledDate;
this.chargedThroughDate = chargedThroughDate;
this.billingStartDate = billingStartDate;
this.billingEndDate = billingEndDate;
this.accountId = accountId;
this.bundleId = bundleId;
this.subscriptionId = subscriptionId;
this.externalKey = externalKey;
this.events = events;
this.deletedEvents = deletedEvents;
this.newEvents = newEvents;
}
public UUID getAccountId() {
return accountId;
}
public void setAccountId(final UUID accountId) {
this.accountId = accountId;
}
public UUID getBundleId() {
return bundleId;
}
public void setBundleId(final UUID bundleId) {
this.bundleId = bundleId;
}
public UUID getSubscriptionId() {
return subscriptionId;
}
public void setSubscriptionId(final UUID subscriptionId) {
this.subscriptionId = subscriptionId;
}
public String getExternalKey() {
return externalKey;
}
public void setExternalKey(final String externalKey) {
this.externalKey = externalKey;
}
public LocalDate getStartDate() {
return startDate;
}
public void setStartDate(final LocalDate startDate) {
this.startDate = startDate;
}
public String getProductName() {
return productName;
}
public void setProductName(final String productName) {
this.productName = productName;
}
public ProductCategory getProductCategory() {
return productCategory;
}
public void setProductCategory(final ProductCategory productCategory) {
this.productCategory = productCategory;
}
public BillingPeriod getBillingPeriod() {
return billingPeriod;
}
public void setBillingPeriod(final BillingPeriod billingPeriod) {
this.billingPeriod = billingPeriod;
}
public String getPriceList() {
return priceList;
}
public void setPriceList(final String priceList) {
this.priceList = priceList;
}
public LocalDate getCancelledDate() {
return cancelledDate;
}
public void setCancelledDate(final LocalDate cancelledDate) {
this.cancelledDate = cancelledDate;
}
public LocalDate getChargedThroughDate() {
return chargedThroughDate;
}
public void setChargedThroughDate(final LocalDate chargedThroughDate) {
this.chargedThroughDate = chargedThroughDate;
}
public LocalDate getBillingStartDate() {
return billingStartDate;
}
public void setBillingStartDate(final LocalDate billingStartDate) {
this.billingStartDate = billingStartDate;
}
public LocalDate getBillingEndDate() {
return billingEndDate;
}
public void setBillingEndDate(final LocalDate billingEndDate) {
this.billingEndDate = billingEndDate;
}
public List getEvents() {
return events;
}
public void setEvents(final List events) {
this.events = events;
}
public List getDeletedEvents() {
return deletedEvents;
}
public void setDeletedEvents(final List deletedEvents) {
this.deletedEvents = deletedEvents;
}
public List getNewEvents() {
return newEvents;
}
public void setNewEvents(final List newEvents) {
this.newEvents = newEvents;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Subscription{");
sb.append("accountId='").append(accountId).append('\'');
sb.append(", bundleId='").append(bundleId).append('\'');
sb.append(", subscriptionId='").append(subscriptionId).append('\'');
sb.append(", externalKey='").append(externalKey).append('\'');
sb.append(", startDate=").append(startDate);
sb.append(", productName='").append(productName).append('\'');
sb.append(", productCategory='").append(productCategory).append('\'');
sb.append(", billingPeriod='").append(billingPeriod).append('\'');
sb.append(", priceList='").append(priceList).append('\'');
sb.append(", cancelledDate=").append(cancelledDate);
sb.append(", chargedThroughDate=").append(chargedThroughDate);
sb.append(", billingStartDate=").append(billingStartDate);
sb.append(", billingEndDate=").append(billingEndDate);
sb.append(", events=").append(events);
sb.append(", deletedEvents=").append(deletedEvents);
sb.append(", newEvents=").append(newEvents);
sb.append('}');
return sb.toString();
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final Subscription that = (Subscription) o;
if (accountId != null ? !accountId.equals(that.accountId) : that.accountId != null) {
return false;
}
if (billingEndDate != null ? billingEndDate.compareTo(that.billingEndDate) != 0 : that.billingEndDate != null) {
return false;
}
if (billingPeriod != null ? !billingPeriod.equals(that.billingPeriod) : that.billingPeriod != null) {
return false;
}
if (billingStartDate != null ? billingStartDate.compareTo(that.billingStartDate) != 0 : that.billingStartDate != null) {
return false;
}
if (bundleId != null ? !bundleId.equals(that.bundleId) : that.bundleId != null) {
return false;
}
if (cancelledDate != null ? cancelledDate.compareTo(that.cancelledDate) != 0 : that.cancelledDate != null) {
return false;
}
if (chargedThroughDate != null ? chargedThroughDate.compareTo(that.chargedThroughDate) != 0 : that.chargedThroughDate != null) {
return false;
}
if (deletedEvents != null ? !deletedEvents.equals(that.deletedEvents) : that.deletedEvents != null) {
return false;
}
if (events != null ? !events.equals(that.events) : that.events != null) {
return false;
}
if (externalKey != null ? !externalKey.equals(that.externalKey) : that.externalKey != null) {
return false;
}
if (newEvents != null ? !newEvents.equals(that.newEvents) : that.newEvents != null) {
return false;
}
if (priceList != null ? !priceList.equals(that.priceList) : that.priceList != null) {
return false;
}
if (productCategory != null ? !productCategory.equals(that.productCategory) : that.productCategory != null) {
return false;
}
if (productName != null ? !productName.equals(that.productName) : that.productName != null) {
return false;
}
if (startDate != null ? startDate.compareTo(that.startDate) != 0 : that.startDate != null) {
return false;
}
if (subscriptionId != null ? !subscriptionId.equals(that.subscriptionId) : that.subscriptionId != null) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = accountId != null ? accountId.hashCode() : 0;
result = 31 * result + (bundleId != null ? bundleId.hashCode() : 0);
result = 31 * result + (subscriptionId != null ? subscriptionId.hashCode() : 0);
result = 31 * result + (externalKey != null ? externalKey.hashCode() : 0);
result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
result = 31 * result + (productName != null ? productName.hashCode() : 0);
result = 31 * result + (productCategory != null ? productCategory.hashCode() : 0);
result = 31 * result + (billingPeriod != null ? billingPeriod.hashCode() : 0);
result = 31 * result + (priceList != null ? priceList.hashCode() : 0);
result = 31 * result + (cancelledDate != null ? cancelledDate.hashCode() : 0);
result = 31 * result + (chargedThroughDate != null ? chargedThroughDate.hashCode() : 0);
result = 31 * result + (billingStartDate != null ? billingStartDate.hashCode() : 0);
result = 31 * result + (billingEndDate != null ? billingEndDate.hashCode() : 0);
result = 31 * result + (events != null ? events.hashCode() : 0);
result = 31 * result + (deletedEvents != null ? deletedEvents.hashCode() : 0);
result = 31 * result + (newEvents != null ? newEvents.hashCode() : 0);
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy