Example usage for java.util Calendar compareTo

List of usage examples for java.util Calendar compareTo

Introduction

In this page you can find the example usage for java.util Calendar compareTo.

Prototype

private int compareTo(long t) 

Source Link

Usage

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.CFAccAddressTagHPKey.java

public int compareTo(Object obj) {
    if (obj == null) {
        return (-1);
    } else if (obj instanceof CFAccAddressTagHBuff) {
        CFAccAddressTagHBuff rhs = (CFAccAddressTagHBuff) obj;
        int retval = 0;
        {/*from  w  ww  . j a v  a 2  s  . co  m*/
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAddressId() < rhs.getRequiredAddressId()) {
            return (-1);
        } else if (getRequiredAddressId() > rhs.getRequiredAddressId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccAddressTagHPKey) {
        CFAccAddressTagHPKey rhs = (CFAccAddressTagHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAddressId() < rhs.getRequiredAddressId()) {
            return (-1);
        } else if (getRequiredAddressId() > rhs.getRequiredAddressId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccHPKey) {
        CFAccHPKey rhs = (CFAccHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        return (0);
    } else if (obj instanceof CFAccAddressTagPKey) {
        CFAccAddressTagPKey rhs = (CFAccAddressTagPKey) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAddressId() < rhs.getRequiredAddressId()) {
            return (-1);
        } else if (getRequiredAddressId() > rhs.getRequiredAddressId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccAddressTagBuff) {
        CFAccAddressTagBuff rhs = (CFAccAddressTagBuff) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAddressId() < rhs.getRequiredAddressId()) {
            return (-1);
        } else if (getRequiredAddressId() > rhs.getRequiredAddressId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "compareTo", "obj",
                obj, "CFAccAddressTagHPKey, CFAccAddressTagPKey, CFAccAddressTagBuff");
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.CFAccAttachmentTagHPKey.java

public int compareTo(Object obj) {
    if (obj == null) {
        return (-1);
    } else if (obj instanceof CFAccAttachmentTagHBuff) {
        CFAccAttachmentTagHBuff rhs = (CFAccAttachmentTagHBuff) obj;
        int retval = 0;
        {/*  ww  w  .j  a v a  2  s.c om*/
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAttachmentId() < rhs.getRequiredAttachmentId()) {
            return (-1);
        } else if (getRequiredAttachmentId() > rhs.getRequiredAttachmentId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccAttachmentTagHPKey) {
        CFAccAttachmentTagHPKey rhs = (CFAccAttachmentTagHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAttachmentId() < rhs.getRequiredAttachmentId()) {
            return (-1);
        } else if (getRequiredAttachmentId() > rhs.getRequiredAttachmentId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccHPKey) {
        CFAccHPKey rhs = (CFAccHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        return (0);
    } else if (obj instanceof CFAccAttachmentTagPKey) {
        CFAccAttachmentTagPKey rhs = (CFAccAttachmentTagPKey) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAttachmentId() < rhs.getRequiredAttachmentId()) {
            return (-1);
        } else if (getRequiredAttachmentId() > rhs.getRequiredAttachmentId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccAttachmentTagBuff) {
        CFAccAttachmentTagBuff rhs = (CFAccAttachmentTagBuff) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAttachmentId() < rhs.getRequiredAttachmentId()) {
            return (-1);
        } else if (getRequiredAttachmentId() > rhs.getRequiredAttachmentId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "compareTo", "obj",
                obj, "CFAccAttachmentTagHPKey, CFAccAttachmentTagPKey, CFAccAttachmentTagBuff");
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.CFAccContactTagHPKey.java

public int compareTo(Object obj) {
    if (obj == null) {
        return (-1);
    } else if (obj instanceof CFAccContactTagHBuff) {
        CFAccContactTagHBuff rhs = (CFAccContactTagHBuff) obj;
        int retval = 0;
        {/* w  w  w  .j ava2s  .  co m*/
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredContactId() < rhs.getRequiredContactId()) {
            return (-1);
        } else if (getRequiredContactId() > rhs.getRequiredContactId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccContactTagHPKey) {
        CFAccContactTagHPKey rhs = (CFAccContactTagHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredContactId() < rhs.getRequiredContactId()) {
            return (-1);
        } else if (getRequiredContactId() > rhs.getRequiredContactId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccHPKey) {
        CFAccHPKey rhs = (CFAccHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        return (0);
    } else if (obj instanceof CFAccContactTagPKey) {
        CFAccContactTagPKey rhs = (CFAccContactTagPKey) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredContactId() < rhs.getRequiredContactId()) {
            return (-1);
        } else if (getRequiredContactId() > rhs.getRequiredContactId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccContactTagBuff) {
        CFAccContactTagBuff rhs = (CFAccContactTagBuff) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredContactId() < rhs.getRequiredContactId()) {
            return (-1);
        } else if (getRequiredContactId() > rhs.getRequiredContactId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "compareTo", "obj",
                obj, "CFAccContactTagHPKey, CFAccContactTagPKey, CFAccContactTagBuff");
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.CFAccMemoTagHPKey.java

public int compareTo(Object obj) {
    if (obj == null) {
        return (-1);
    } else if (obj instanceof CFAccMemoTagHBuff) {
        CFAccMemoTagHBuff rhs = (CFAccMemoTagHBuff) obj;
        int retval = 0;
        {/* www  .  ja v a 2 s  .  c o m*/
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredMemoId() < rhs.getRequiredMemoId()) {
            return (-1);
        } else if (getRequiredMemoId() > rhs.getRequiredMemoId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccMemoTagHPKey) {
        CFAccMemoTagHPKey rhs = (CFAccMemoTagHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredMemoId() < rhs.getRequiredMemoId()) {
            return (-1);
        } else if (getRequiredMemoId() > rhs.getRequiredMemoId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccHPKey) {
        CFAccHPKey rhs = (CFAccHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        return (0);
    } else if (obj instanceof CFAccMemoTagPKey) {
        CFAccMemoTagPKey rhs = (CFAccMemoTagPKey) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredMemoId() < rhs.getRequiredMemoId()) {
            return (-1);
        } else if (getRequiredMemoId() > rhs.getRequiredMemoId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccMemoTagBuff) {
        CFAccMemoTagBuff rhs = (CFAccMemoTagBuff) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredMemoId() < rhs.getRequiredMemoId()) {
            return (-1);
        } else if (getRequiredMemoId() > rhs.getRequiredMemoId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "compareTo", "obj",
                obj, "CFAccMemoTagHPKey, CFAccMemoTagPKey, CFAccMemoTagBuff");
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.CFAccPhoneTagHPKey.java

public int compareTo(Object obj) {
    if (obj == null) {
        return (-1);
    } else if (obj instanceof CFAccPhoneTagHBuff) {
        CFAccPhoneTagHBuff rhs = (CFAccPhoneTagHBuff) obj;
        int retval = 0;
        {/*from www  .  jav a 2s .c  o  m*/
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredPhoneId() < rhs.getRequiredPhoneId()) {
            return (-1);
        } else if (getRequiredPhoneId() > rhs.getRequiredPhoneId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccPhoneTagHPKey) {
        CFAccPhoneTagHPKey rhs = (CFAccPhoneTagHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredPhoneId() < rhs.getRequiredPhoneId()) {
            return (-1);
        } else if (getRequiredPhoneId() > rhs.getRequiredPhoneId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccHPKey) {
        CFAccHPKey rhs = (CFAccHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        return (0);
    } else if (obj instanceof CFAccPhoneTagPKey) {
        CFAccPhoneTagPKey rhs = (CFAccPhoneTagPKey) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredPhoneId() < rhs.getRequiredPhoneId()) {
            return (-1);
        } else if (getRequiredPhoneId() > rhs.getRequiredPhoneId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else if (obj instanceof CFAccPhoneTagBuff) {
        CFAccPhoneTagBuff rhs = (CFAccPhoneTagBuff) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredPhoneId() < rhs.getRequiredPhoneId()) {
            return (-1);
        } else if (getRequiredPhoneId() > rhs.getRequiredPhoneId()) {
            return (1);
        }
        if (getRequiredTagId() < rhs.getRequiredTagId()) {
            return (-1);
        } else if (getRequiredTagId() > rhs.getRequiredTagId()) {
            return (1);
        }
        return (0);
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "compareTo", "obj",
                obj, "CFAccPhoneTagHPKey, CFAccPhoneTagPKey, CFAccPhoneTagBuff");
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.CFAccAccountEntryHPKey.java

public int compareTo(Object obj) {
    if (obj == null) {
        return (-1);
    } else if (obj instanceof CFAccAccountEntryHBuff) {
        CFAccAccountEntryHBuff rhs = (CFAccAccountEntryHBuff) obj;
        int retval = 0;
        {/*ww  w  .  j a  va  2  s . c  om*/
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAccountId() < rhs.getRequiredAccountId()) {
            return (-1);
        } else if (getRequiredAccountId() > rhs.getRequiredAccountId()) {
            return (1);
        }
        {
            int cmp = getRequiredEntryId().compareTo(rhs.getRequiredEntryId());
            if (cmp != 0) {
                return (cmp);
            }
        }
        return (0);
    } else if (obj instanceof CFAccAccountEntryHPKey) {
        CFAccAccountEntryHPKey rhs = (CFAccAccountEntryHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAccountId() < rhs.getRequiredAccountId()) {
            return (-1);
        } else if (getRequiredAccountId() > rhs.getRequiredAccountId()) {
            return (1);
        }
        {
            int cmp = getRequiredEntryId().compareTo(rhs.getRequiredEntryId());
            if (cmp != 0) {
                return (cmp);
            }
        }
        return (0);
    } else if (obj instanceof CFAccHPKey) {
        CFAccHPKey rhs = (CFAccHPKey) obj;
        {
            long lhsAuditClusterId = getAuditClusterId();
            long rhsAuditClusterId = rhs.getAuditClusterId();
            if (lhsAuditClusterId < rhsAuditClusterId) {
                return (-1);
            } else if (lhsAuditClusterId > rhsAuditClusterId) {
                return (1);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp == null) {
                if (rhsAuditStamp != null) {
                    return (-1);
                }
            } else if (rhsAuditStamp == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        {
            short lhsAuditActionId = getAuditActionId();
            short rhsAuditActionId = rhs.getAuditActionId();
            if (lhsAuditActionId < rhsAuditActionId) {
                return (-1);
            } else if (lhsAuditActionId > rhsAuditActionId) {
                return (1);
            }
        }
        {
            int lhsRequiredRevision = getRequiredRevision();
            int rhsRequiredRevision = rhs.getRequiredRevision();
            if (lhsRequiredRevision < rhsRequiredRevision) {
                return (-1);
            } else if (lhsRequiredRevision > rhsRequiredRevision) {
                return (1);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId == null) {
                if (rhsAuditSessionId != null) {
                    return (-1);
                }
            } else if (rhsAuditSessionId == null) {
                return (1);
            } else {
                int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
                if (cmpstat != 0) {
                    return (cmpstat);
                }
            }
        }
        return (0);
    } else if (obj instanceof CFAccAccountEntryPKey) {
        CFAccAccountEntryPKey rhs = (CFAccAccountEntryPKey) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAccountId() < rhs.getRequiredAccountId()) {
            return (-1);
        } else if (getRequiredAccountId() > rhs.getRequiredAccountId()) {
            return (1);
        }
        {
            int cmp = getRequiredEntryId().compareTo(rhs.getRequiredEntryId());
            if (cmp != 0) {
                return (cmp);
            }
        }
        return (0);
    } else if (obj instanceof CFAccAccountEntryBuff) {
        CFAccAccountEntryBuff rhs = (CFAccAccountEntryBuff) obj;
        if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
            return (-1);
        } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
            return (1);
        }
        if (getRequiredAccountId() < rhs.getRequiredAccountId()) {
            return (-1);
        } else if (getRequiredAccountId() > rhs.getRequiredAccountId()) {
            return (1);
        }
        {
            int cmp = getRequiredEntryId().compareTo(rhs.getRequiredEntryId());
            if (cmp != 0) {
                return (cmp);
            }
        }
        return (0);
    } else {
        throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "compareTo", "obj",
                obj, "CFAccAccountEntryHPKey, CFAccAccountEntryPKey, CFAccAccountEntryBuff");
    }
}

From source file:nl.strohalm.cyclos.services.elements.CommissionServiceImpl.java

@Override
public BrokeringCommissionStatus createBrokeringCommissionStatus(final Brokering brokering,
        final BrokerCommission brokerCommission) {
    // Create new instance
    final BrokeringCommissionStatus brokeringCommissionStatus = new BrokeringCommissionStatus();
    brokeringCommissionStatus.setBrokering(brokering);
    brokeringCommissionStatus.setBrokerCommission(brokerCommission);
    brokeringCommissionStatus.setCreationDate(Calendar.getInstance());
    boolean fillFromCommission = true;

    if (brokerCommission.isFromMember()) {
        // Get the data from the default broker commission
        final DefaultBrokerCommission defaultBrokerCommission = getDefaultBrokerCommission(
                brokering.getBroker(), brokerCommission);
        if (defaultBrokerCommission != null) {
            brokeringCommissionStatus.setAmount(defaultBrokerCommission.getAmount());
            brokeringCommissionStatus.setWhen(defaultBrokerCommission.getWhen());
            brokeringCommissionStatus.setMaxCount(defaultBrokerCommission.getCount());
            fillFromCommission = false;/*  w  ww.  ja  v  a 2 s.  c o  m*/
        }
    }
    if (fillFromCommission) {
        // Get the data from the broker commission
        brokeringCommissionStatus.setAmount(brokerCommission.getAmount());
        brokeringCommissionStatus.setWhen(brokerCommission.getWhen());
        brokeringCommissionStatus.setMaxCount(brokerCommission.getCount());
    }

    // Set total
    final TransactionSummaryVO total = new TransactionSummaryVO();
    total.setCount(0);
    total.setAmount(new BigDecimal(0));
    brokeringCommissionStatus.setTotal(total);

    // Period
    final Period period = new Period();
    period.setBegin(brokering.getStartDate());

    // If the commission has a validity (number of days), set expiration date on the commission status and check if it is not expired
    if (brokeringCommissionStatus.getWhen() == BrokerCommission.When.DAYS) {

        // Calculate and set expiration date
        final Calendar brokeringStartDate = brokering.getStartDate();
        final int daysCount = brokeringCommissionStatus.getMaxCount();
        final Calendar expirationDate = new TimePeriod(daysCount, Field.DAYS).add(brokeringStartDate);
        brokeringCommissionStatus.setExpiryDate(expirationDate);

        // Check if the brokering commission status is expired
        final Calendar now = Calendar.getInstance();
        if (now.compareTo(expirationDate) >= 0) {
            period.setEnd(expirationDate);
        }
    }

    // Set period
    brokeringCommissionStatus.setPeriod(period);

    return brokeringCommissionStatusDao.insert(brokeringCommissionStatus);
}

From source file:eu.riscoss.rdc.RDCGithub.java

/**
 * For paginated requests/*from w ww .  j  a v a2 s  . co m*/
 * @param request
 * @param maxPages max pages in paginated requests
 * @param created_at_years maximum timespan for the "created at" field (used e.g. for issues). 0: no timespan
 * @return
 */
private JSONAware parsePaged(String request, int maxPages, int created_at_years) {

    JSONArray jaComplete = new JSONArray();

    char divider = '?';
    if (request.contains("?"))
        divider = '&';

    Calendar lastyear = Calendar.getInstance();//actual
    lastyear.set(Calendar.YEAR, lastyear.get(Calendar.YEAR) - created_at_years);

    try {
        for (int i = 1; i <= maxPages; i++) {

            String jsonPage = getData(repository + request + divider + "page=" + i, "");

            if (jsonPage.startsWith("WARNING")) {
                System.err.println(jsonPage); //error message - implement different handling if needed
            } else
                try {
                    JSONAware jv = (JSONAware) new JSONParser().parse(jsonPage);
                    if (jv instanceof JSONArray) {
                        JSONArray ja = (JSONArray) jv;
                        if (ja.size() == 0)
                            break;
                        jaComplete.addAll(ja);
                        //do not scan more years
                        if (created_at_years > 0) {
                            Calendar openedDate;
                            String openedAt = (String) ((JSONObject) ja.get(ja.size() - 1)).get("created_at");
                            if (openedAt != null) {
                                openedDate = DatatypeConverter.parseDateTime(openedAt);
                                //System.out.println("scan: opening date: "+openedDate.get(Calendar.YEAR)+" "+openedDate.get(Calendar.MONTH));
                                //System.out.println("scan: last    date: "+lastyear.get(Calendar.YEAR)+" "+lastyear.get(Calendar.MONTH));

                                if (openedDate.compareTo(lastyear) < 0) {
                                    System.out.println("BREAK");
                                    break;
                                }
                            }
                        }

                    }
                } catch (ParseException e) {
                    e.printStackTrace();//TODO
                }
        }

    } catch (org.apache.http.ParseException e1) {
        e1.printStackTrace();
    } catch (IOException e1) {
        e1.printStackTrace();
    }
    return jaComplete;
}

From source file:com.groksolutions.grok.mobile.annotation.AnnotationListFragment.java

/**
 * Update list with all annotations for the given server for the given range
 *
 * @param server Filter annotations by server
 * @param from   return records from this date
 * @param to     return records up to this date
 *//*from ww w.  j  a va2  s .  c  o  m*/
public void updateList(final String server, final Date from, final Date to) {
    new AsyncTask<Void, Void, List<Annotation>>() {
        @Override
        protected void onPostExecute(final List<Annotation> result) {
            _adapter.clear();
            _annotations = new ArrayList<Pair<Annotation, Boolean>>();
            boolean showDate;

            Calendar annotationTimestamp = Calendar.getInstance();
            Calendar created = Calendar.getInstance();
            Calendar previousCreated = Calendar.getInstance();
            Calendar previousAnnotation = Calendar.getInstance();
            previousCreated.setTimeInMillis(0);
            previousAnnotation.setTimeInMillis(0);

            for (Annotation annotation : result) {
                annotationTimestamp.setTimeInMillis(annotation.getTimestamp());
                created.setTimeInMillis(annotation.getCreated());
                if (previousAnnotation.getTimeInMillis() == 0) {
                    // Initialize previous values
                    previousAnnotation.setTimeInMillis(annotationTimestamp.getTimeInMillis());
                    previousCreated.setTimeInMillis(created.getTimeInMillis());
                }
                // Show date only if the "created" day is different from the previous day
                if (annotationTimestamp.compareTo(previousAnnotation) != 0) {
                    // Do not show date for first annotation
                    showDate = false;
                    // Reset first date to be the annotation timestamp
                    previousCreated.setTimeInMillis(annotationTimestamp.getTimeInMillis());
                } else if (previousCreated.get(Calendar.YEAR) != created.get(Calendar.YEAR)) {
                    showDate = true;
                } else if (previousCreated.get(Calendar.MONTH) != created.get(Calendar.MONTH)) {
                    showDate = true;
                } else if (previousCreated.get(Calendar.DAY_OF_MONTH) != created.get(Calendar.DAY_OF_MONTH)) {
                    showDate = true;
                } else {
                    // The date is the same, only show time
                    showDate = false;
                }
                // Add formatted annotation to list
                _annotations.add(new Pair<Annotation, Boolean>(annotation, showDate));
                _adapter.add(formatAnnotationBody(annotation));

                previousCreated.setTimeInMillis(created.getTimeInMillis());
                previousAnnotation.setTimeInMillis(annotationTimestamp.getTimeInMillis());
            }
        }

        @Override
        protected List<Annotation> doInBackground(Void... params) {
            return HTMITApplication.getDatabase().getAnnotations(server, from, to);
        }
    }.execute();
}

From source file:com.YOMPsolutions.YOMP.mobile.annotation.AnnotationListFragment.java

/**
 * Update list with all annotations for the given server for the given range
 *
 * @param server Filter annotations by server
 * @param from   return records from this date
 * @param to     return records up to this date
 *///w  ww  . ja v  a2s  . c  om
public void updateList(final String server, final Date from, final Date to) {
    new AsyncTask<Void, Void, List<Annotation>>() {
        @Override
        protected void onPostExecute(final List<Annotation> result) {
            _adapter.clear();
            _annotations = new ArrayList<Pair<Annotation, Boolean>>();
            boolean showDate;

            Calendar annotationTimestamp = Calendar.getInstance();
            Calendar created = Calendar.getInstance();
            Calendar previousCreated = Calendar.getInstance();
            Calendar previousAnnotation = Calendar.getInstance();
            previousCreated.setTimeInMillis(0);
            previousAnnotation.setTimeInMillis(0);

            for (Annotation annotation : result) {
                annotationTimestamp.setTimeInMillis(annotation.getTimestamp());
                created.setTimeInMillis(annotation.getCreated());
                if (previousAnnotation.getTimeInMillis() == 0) {
                    // Initialize previous values
                    previousAnnotation.setTimeInMillis(annotationTimestamp.getTimeInMillis());
                    previousCreated.setTimeInMillis(created.getTimeInMillis());
                }
                // Show date only if the "created" day is different from the previous day
                if (annotationTimestamp.compareTo(previousAnnotation) != 0) {
                    // Do not show date for first annotation
                    showDate = false;
                    // Reset first date to be the annotation timestamp
                    previousCreated.setTimeInMillis(annotationTimestamp.getTimeInMillis());
                } else if (previousCreated.get(Calendar.YEAR) != created.get(Calendar.YEAR)) {
                    showDate = true;
                } else if (previousCreated.get(Calendar.MONTH) != created.get(Calendar.MONTH)) {
                    showDate = true;
                } else if (previousCreated.get(Calendar.DAY_OF_MONTH) != created.get(Calendar.DAY_OF_MONTH)) {
                    showDate = true;
                } else {
                    // The date is the same, only show time
                    showDate = false;
                }
                // Add formatted annotation to list
                _annotations.add(new Pair<Annotation, Boolean>(annotation, showDate));
                _adapter.add(formatAnnotationBody(annotation));

                previousCreated.setTimeInMillis(created.getTimeInMillis());
                previousAnnotation.setTimeInMillis(annotationTimestamp.getTimeInMillis());
            }
        }

        @Override
        protected List<Annotation> doInBackground(Void... params) {
            return YOMPApplication.getDatabase().getAnnotations(server, from, to);
        }
    }.execute();
}