com.bemis.portal.migration.customer.service.persistence.CustomerOrgPK.java Source code

Java tutorial

Introduction

Here is the source code for com.bemis.portal.migration.customer.service.persistence.CustomerOrgPK.java

Source

/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.bemis.portal.migration.customer.service.persistence;

import aQute.bnd.annotation.ProviderType;

import com.liferay.portal.kernel.util.HashUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;

import java.io.Serializable;

/**
 * @author Abdullah Bushnaq
 * @generated
 */
@ProviderType
public class CustomerOrgPK implements Comparable<CustomerOrgPK>, Serializable {
    public String bemisCustomerId;
    public String bemisParentId;
    public String customerName;
    public String customerAlias;
    public String streetNumber;
    public String streetName;
    public String streetAddress;
    public String city;
    public String state;
    public String zip;
    public String country;

    public CustomerOrgPK() {
    }

    public CustomerOrgPK(String bemisCustomerId, String bemisParentId, String customerName, String customerAlias,
            String streetNumber, String streetName, String streetAddress, String city, String state, String zip,
            String country) {
        this.bemisCustomerId = bemisCustomerId;
        this.bemisParentId = bemisParentId;
        this.customerName = customerName;
        this.customerAlias = customerAlias;
        this.streetNumber = streetNumber;
        this.streetName = streetName;
        this.streetAddress = streetAddress;
        this.city = city;
        this.state = state;
        this.zip = zip;
        this.country = country;
    }

    public String getBemisCustomerId() {
        return bemisCustomerId;
    }

    public void setBemisCustomerId(String bemisCustomerId) {
        this.bemisCustomerId = bemisCustomerId;
    }

    public String getBemisParentId() {
        return bemisParentId;
    }

    public void setBemisParentId(String bemisParentId) {
        this.bemisParentId = bemisParentId;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getCustomerAlias() {
        return customerAlias;
    }

    public void setCustomerAlias(String customerAlias) {
        this.customerAlias = customerAlias;
    }

    public String getStreetNumber() {
        return streetNumber;
    }

    public void setStreetNumber(String streetNumber) {
        this.streetNumber = streetNumber;
    }

    public String getStreetName() {
        return streetName;
    }

    public void setStreetName(String streetName) {
        this.streetName = streetName;
    }

    public String getStreetAddress() {
        return streetAddress;
    }

    public void setStreetAddress(String streetAddress) {
        this.streetAddress = streetAddress;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getZip() {
        return zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    @Override
    public int compareTo(CustomerOrgPK pk) {
        if (pk == null) {
            return -1;
        }

        int value = 0;

        value = bemisCustomerId.compareTo(pk.bemisCustomerId);

        if (value != 0) {
            return value;
        }

        value = bemisParentId.compareTo(pk.bemisParentId);

        if (value != 0) {
            return value;
        }

        value = customerName.compareTo(pk.customerName);

        if (value != 0) {
            return value;
        }

        value = customerAlias.compareTo(pk.customerAlias);

        if (value != 0) {
            return value;
        }

        value = streetNumber.compareTo(pk.streetNumber);

        if (value != 0) {
            return value;
        }

        value = streetName.compareTo(pk.streetName);

        if (value != 0) {
            return value;
        }

        value = streetAddress.compareTo(pk.streetAddress);

        if (value != 0) {
            return value;
        }

        value = city.compareTo(pk.city);

        if (value != 0) {
            return value;
        }

        value = state.compareTo(pk.state);

        if (value != 0) {
            return value;
        }

        value = zip.compareTo(pk.zip);

        if (value != 0) {
            return value;
        }

        value = country.compareTo(pk.country);

        if (value != 0) {
            return value;
        }

        return 0;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }

        if (!(obj instanceof CustomerOrgPK)) {
            return false;
        }

        CustomerOrgPK pk = (CustomerOrgPK) obj;

        if ((bemisCustomerId.equals(pk.bemisCustomerId)) && (bemisParentId.equals(pk.bemisParentId))
                && (customerName.equals(pk.customerName)) && (customerAlias.equals(pk.customerAlias))
                && (streetNumber.equals(pk.streetNumber)) && (streetName.equals(pk.streetName))
                && (streetAddress.equals(pk.streetAddress)) && (city.equals(pk.city)) && (state.equals(pk.state))
                && (zip.equals(pk.zip)) && (country.equals(pk.country))) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        int hashCode = 0;

        hashCode = HashUtil.hash(hashCode, bemisCustomerId);
        hashCode = HashUtil.hash(hashCode, bemisParentId);
        hashCode = HashUtil.hash(hashCode, customerName);
        hashCode = HashUtil.hash(hashCode, customerAlias);
        hashCode = HashUtil.hash(hashCode, streetNumber);
        hashCode = HashUtil.hash(hashCode, streetName);
        hashCode = HashUtil.hash(hashCode, streetAddress);
        hashCode = HashUtil.hash(hashCode, city);
        hashCode = HashUtil.hash(hashCode, state);
        hashCode = HashUtil.hash(hashCode, zip);
        hashCode = HashUtil.hash(hashCode, country);

        return hashCode;
    }

    @Override
    public String toString() {
        StringBundler sb = new StringBundler(55);

        sb.append(StringPool.OPEN_CURLY_BRACE);

        sb.append("bemisCustomerId");
        sb.append(StringPool.EQUAL);
        sb.append(bemisCustomerId);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("bemisParentId");
        sb.append(StringPool.EQUAL);
        sb.append(bemisParentId);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("customerName");
        sb.append(StringPool.EQUAL);
        sb.append(customerName);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("customerAlias");
        sb.append(StringPool.EQUAL);
        sb.append(customerAlias);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("streetNumber");
        sb.append(StringPool.EQUAL);
        sb.append(streetNumber);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("streetName");
        sb.append(StringPool.EQUAL);
        sb.append(streetName);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("streetAddress");
        sb.append(StringPool.EQUAL);
        sb.append(streetAddress);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("city");
        sb.append(StringPool.EQUAL);
        sb.append(city);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("state");
        sb.append(StringPool.EQUAL);
        sb.append(state);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("zip");
        sb.append(StringPool.EQUAL);
        sb.append(zip);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("country");
        sb.append(StringPool.EQUAL);
        sb.append(country);

        sb.append(StringPool.CLOSE_CURLY_BRACE);

        return sb.toString();
    }
}