Demo entry 6686728

Java

   

Submitted by anonymous on Dec 25, 2017 at 03:15
Language: Java. Code size: 3.0 kB.

/**
 * <p><owner>10208178</owner> </p>
 * <p><createdate>2017/9/22</createdate></p> 
 * <p>文件名称: RuleBean.java</p>
 * <p>文件描述: 无</p>
 * <p>版权所有: 版权所有(C)2001-2020</p>
 * <p>公司名称: 深圳市中兴通讯股份有限公司</p>
 * <p>内容摘要: 无</p>
 * <p>其他说明: 无</p>
 * <p>创建日期:2017/9/22</p>
 * <p>完成日期:2017/9/22</p>
 * <p>修改记录1: // 修改历史记录,包括修改日期、修改者及修改内容</p>
 * <pre>
 *    修改日期:
 *    版 本 号:
 *    修 改 人:
 *    修改内容:
 * </pre>
 * <p>评审记录1: // 评审历史记录,包括评审日期、评审人及评审内容</p>
 * <pre>
 *    评审日期:
 *    版 本 号:
 *    评 审 人:
 *    评审内容:
 * </pre>
 * @version 1.0
 * @author 周明
 */
package com.zte.dap.manager.intelligence;

import com.google.common.annotations.VisibleForTesting;

/**
 * 功能描述:<br>
 * <p/>
 * <p/>
 * <p/>
 * Note:
 *
 * @author 10208178
 * @version 1.0
 */
public class RuleBean implements Comparable<RuleBean>
{
    private BasicRuleBean basicRuleBean;
    private BasicRuleBean parentRule;
    private BasicRuleBean subRule;

    public RuleBean()
    {
        basicRuleBean = new BasicRuleBean();
        parentRule = new BasicRuleBean();
        subRule = new BasicRuleBean();
    }

    @VisibleForTesting
    public RuleBean(BasicRuleBean basicRuleBean)
    {
        this.basicRuleBean = basicRuleBean;
    }

    public BasicRuleBean getBasicRuleBean()
    {
        return basicRuleBean;
    }

    public void setBasicRuleBean(BasicRuleBean basicRuleBean)
    {
        this.basicRuleBean = basicRuleBean;
    }

    public BasicRuleBean getParentRule()
    {
        return parentRule;
    }

    public void setParentRule(BasicRuleBean parentRule)
    {
        this.parentRule = parentRule;
    }

    public BasicRuleBean getSubRule()
    {
        return subRule;
    }

    public void setSubRule(BasicRuleBean subRule)
    {
        this.subRule = subRule;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;
        RuleBean that = (RuleBean) o;
        return basicRuleBean.equals(that.getBasicRuleBean()) && parentRule
            .equals(that.getParentRule()) && subRule.equals(that.getSubRule());
    }

    @Override
    public int hashCode()
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((basicRuleBean == null) ? 0 : basicRuleBean.hashCode());
        result = prime * result + ((parentRule == null) ? 0 : parentRule.hashCode());
        result = prime * result + ((subRule == null) ? 0 : subRule.hashCode());
        return result;
    }

    @Override
    public int compareTo(RuleBean o)
    {

        if (!basicRuleBean.equals(o.getBasicRuleBean()))
        {
            return basicRuleBean.compareTo(o.getBasicRuleBean());
        }
        if (!parentRule.equals(o.getParentRule()))
        {
            return parentRule.compareTo(o.getParentRule());
        }
        return subRule.compareTo(o.getSubRule());
    }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).