001/*
002 * Copyright 2010-2013 Ning, Inc.
003 *
004 * Ning licenses this file to you under the Apache License, version 2.0
005 * (the "License"); you may not use this file except in compliance with the
006 * License.  You may obtain a copy of the License at:
007 *
008 *    http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
013 * License for the specific language governing permissions and limitations
014 * under the License.
015 */
016
017package com.ning.billing.recurly.model.push.subscription;
018
019import javax.xml.bind.annotation.XmlElement;
020
021import com.ning.billing.recurly.model.Subscription;
022
023public class PushSubscription extends Subscription {
024
025    @XmlElement(name = "total_amount_in_cents")
026    private Integer totalAmountInCents;
027
028    public Integer getTotalAmountInCents() {
029        return totalAmountInCents;
030    }
031
032    public void setTotalAmountInCents(final Object totalAmountInCents) {
033        this.totalAmountInCents = integerOrNull(totalAmountInCents);
034    }
035
036    @Override
037    public boolean equals(final Object o) {
038        if (this == o) {
039            return true;
040        }
041        if (!(o instanceof PushSubscription)) {
042            return false;
043        }
044        if (!super.equals(o)) {
045            return false;
046        }
047
048        final PushSubscription that = (PushSubscription) o;
049
050        if (totalAmountInCents != null ? !totalAmountInCents.equals(that.totalAmountInCents) : that.totalAmountInCents != null) {
051            return false;
052        }
053
054        return true;
055    }
056
057    @Override
058    public int hashCode() {
059        int result = super.hashCode();
060        result = 31 * result + (totalAmountInCents != null ? totalAmountInCents.hashCode() : 0);
061        return result;
062    }
063}