001/*
002 * Copyright 2010-2014 Ning, Inc.
003 * Copyright 2014-2015 The Billing Project, LLC
004 *
005 * The Billing Project licenses this file to you under the Apache License, version 2.0
006 * (the "License"); you may not use this file except in compliance with the
007 * License.  You may obtain a copy of the License at:
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
014 * License for the specific language governing permissions and limitations
015 * under the License.
016 */
017
018package com.ning.billing.recurly.model;
019
020import javax.xml.bind.annotation.XmlElement;
021import javax.xml.bind.annotation.XmlRootElement;
022
023import com.google.common.base.Objects;
024
025@XmlRootElement(name = "verify")
026public class BillingInfoVerification extends RecurlyObject {
027
028    @XmlElement(name = "gateway_code")
029    private String gatewayCode;
030
031    public String getGatewayCode() {
032        return gatewayCode;
033    }
034
035    public void setGatewayCode(final Object gatewayCode) {
036        this.gatewayCode = stringOrNull(gatewayCode);
037    }
038
039    @Override
040    public String toString() {
041        final StringBuilder sb = new StringBuilder();
042        sb.append("Verify");
043        sb.append("{gatewayCode=").append(gatewayCode);
044        sb.append('}');
045        return sb.toString();
046    }
047
048    @Override
049    public boolean equals(final Object o) {
050        if (this == o) return true;
051        if (o == null || getClass() != o.getClass()) return false;
052
053        final BillingInfoVerification that = (BillingInfoVerification) o;
054
055        if (gatewayCode != null ? !gatewayCode.equals(that.gatewayCode) : that.gatewayCode != null) {
056            return false;
057        }
058        return true;
059    }
060
061    @Override
062    public int hashCode() {
063        return Objects.hashCode(
064                gatewayCode
065        );
066    }
067
068}