net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternet.CFInternetISOTimezonePKey.java Source code

Java tutorial

Introduction

Here is the source code for net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternet.CFInternetISOTimezonePKey.java

Source

// Description: Java7 implementation of a ISOTimezone primary key object.

/*
 *   CF Customer Information Managerment template model
 *
 *   Copyright (c) 2010-2014 Mark Sobkow
 *   
 *      Licensed 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.
 *   
 * ***********************************************************************
 *
 *   Code manufactured by MSS Code Factory
 */

package net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternet;

import java.lang.reflect.*;
import java.io.*;
import java.math.*;
import java.net.*;
import java.rmi.*;
import java.sql.*;
import java.text.*;
import java.util.*;
import net.sourceforge.msscodefactory.cflib.v1_11.CFLib.*;
import org.apache.commons.codec.binary.Base64;

/*
 *   CFInternetISOTimezonePKey Primary Key for ISOTimezone
    
 *      requiredISOTimezoneId   Required object attribute ISOTimezoneId. */
public class CFInternetISOTimezonePKey implements Comparable<Object>, Serializable {

    protected short requiredISOTimezoneId;

    public CFInternetISOTimezonePKey() {
        requiredISOTimezoneId = CFInternetISOTimezoneBuff.ISOTIMEZONEID_INIT_VALUE;
    }

    public short getRequiredISOTimezoneId() {
        return (requiredISOTimezoneId);
    }

    public void setRequiredISOTimezoneId(short value) {
        if (value < CFInternetISOTimezoneBuff.ISOTIMEZONEID_MIN_VALUE) {
            throw CFLib.getDefaultExceptionFactory().newArgumentUnderflowException(getClass(),
                    "setRequiredISOTimezoneId", 1, "value", value,
                    CFInternetISOTimezoneBuff.ISOTIMEZONEID_MIN_VALUE);
        }
        requiredISOTimezoneId = value;
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return (false);
        } else if (obj instanceof CFInternetISOTimezoneHPKey) {
            CFInternetISOTimezoneHPKey rhs = (CFInternetISOTimezoneHPKey) obj;
            if (getRequiredISOTimezoneId() != rhs.getRequiredISOTimezoneId()) {
                return (false);
            }
            return (true);
        } else if (obj instanceof CFInternetISOTimezonePKey) {
            CFInternetISOTimezonePKey rhs = (CFInternetISOTimezonePKey) obj;
            if (getRequiredISOTimezoneId() != rhs.getRequiredISOTimezoneId()) {
                return (false);
            }
            return (true);
        } else if (obj instanceof CFInternetISOTimezoneHBuff) {
            CFInternetISOTimezoneHBuff rhs = (CFInternetISOTimezoneHBuff) obj;
            if (getRequiredISOTimezoneId() != rhs.getRequiredISOTimezoneId()) {
                return (false);
            }
            return (true);
        } else if (obj instanceof CFInternetISOTimezoneBuff) {
            CFInternetISOTimezoneBuff rhs = (CFInternetISOTimezoneBuff) obj;
            if (getRequiredISOTimezoneId() != rhs.getRequiredISOTimezoneId()) {
                return (false);
            }
            return (true);
        } else {
            return (false);
        }
    }

    public int hashCode() {
        int hashCode = 0;
        hashCode = (hashCode * 0x10000) + getRequiredISOTimezoneId();
        return (hashCode & 0x7fffffff);
    }

    public int compareTo(Object obj) {
        if (obj == null) {
            return (-1);
        } else if (obj instanceof CFInternetISOTimezoneHPKey) {
            CFInternetISOTimezoneHPKey rhs = (CFInternetISOTimezoneHPKey) obj;
            if (getRequiredISOTimezoneId() < rhs.getRequiredISOTimezoneId()) {
                return (-1);
            } else if (getRequiredISOTimezoneId() > rhs.getRequiredISOTimezoneId()) {
                return (1);
            }
            return (0);
        } else if (obj instanceof CFInternetISOTimezonePKey) {
            CFInternetISOTimezonePKey rhs = (CFInternetISOTimezonePKey) obj;
            if (getRequiredISOTimezoneId() < rhs.getRequiredISOTimezoneId()) {
                return (-1);
            } else if (getRequiredISOTimezoneId() > rhs.getRequiredISOTimezoneId()) {
                return (1);
            }
            return (0);
        } else if (obj instanceof CFInternetISOTimezoneBuff) {
            CFInternetISOTimezoneBuff rhs = (CFInternetISOTimezoneBuff) obj;
            if (getRequiredISOTimezoneId() < rhs.getRequiredISOTimezoneId()) {
                return (-1);
            } else if (getRequiredISOTimezoneId() > rhs.getRequiredISOTimezoneId()) {
                return (1);
            }
            return (0);
        } else if (obj instanceof CFInternetISOTimezoneHBuff) {
            CFInternetISOTimezoneHBuff rhs = (CFInternetISOTimezoneHBuff) obj;
            if (getRequiredISOTimezoneId() < rhs.getRequiredISOTimezoneId()) {
                return (-1);
            } else if (getRequiredISOTimezoneId() > rhs.getRequiredISOTimezoneId()) {
                return (1);
            }
            return (0);
        } else {
            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "compareTo", "obj",
                    obj, "CFInternetISOTimezonePKey, CFInternetISOTimezoneBuff");
        }
    }

    public String toString() {
        String ret = "<CFInternetISOTimezonePKey" + " RequiredISOTimezoneId=" + "\""
                + Short.toString(getRequiredISOTimezoneId()) + "\"" + "/>";
        return (ret);
    }
}