List接口的contains方法进行实体对象类比较

package com.xiaoxiu.common.biz.pms.dao.dataobject;

import com.xiaoxiu.common.dataobject.BaseDO;
import java.util.Date;

public class PermissionDO extends BaseDO {

 /**
  * This field corresponds to the database column PMS_PERMISSION.ID column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private Long id;
 /**
  * This field corresponds to the database column PMS_PERMISSION.NAME column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private String name;
 /**
  * This field corresponds to the database column PMS_PERMISSION.CODE column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private String code;
 /**
  * This field corresponds to the database column PMS_PERMISSION.STATUS column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private Integer status;
 /**
  * This field corresponds to the database column PMS_PERMISSION.ACTION_URL column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private String actionURL;
 /**
  * This field corresponds to the database column PMS_PERMISSION.MENU_LEVEL column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private Integer menuLevel;
 /**
  * This field corresponds to the database column PMS_PERMISSION.PARENT_ID column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private Long parentId;
 /**
  * This field corresponds to the database column PMS_PERMISSION.CREATE_DATE column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private Date createDate;
 /**
  * This field corresponds to the database column PMS_PERMISSION.UPDATE_DATE column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private Date updateDate;
 /**
  * This field corresponds to the database column PMS_PERMISSION.IS_MENU column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private Integer isMenu;
 /**
  * This field corresponds to the database column PMS_PERMISSION.SORT column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private Long sort;
 /**
  * This field corresponds to the database column PMS_PERMISSION.PERMISSION_COMMENT column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private String permissionComment;
 /**
  * This field corresponds to the database column PMS_PERMISSION.IS_MENU_SHOW column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 private Integer isMenuShow;

 /**
  * This method returns the value of the database column PMS_PERMISSION.ID
  * @return  the value of PMS_PERMISSION.ID column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public Long getId() {
  return id;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.ID
  * @param id  the value for PMS_PERMISSION.ID column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setId(Long id) {
  this.id = id;
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.NAME
  * @return  the value of PMS_PERMISSION.NAME column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public String getName() {
  return name;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.NAME
  * @param name  the value for PMS_PERMISSION.NAME column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setName(String name) {
  this.name = name == null ? null : name.trim();
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.CODE
  * @return  the value of PMS_PERMISSION.CODE column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public String getCode() {
  return code;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.CODE
  * @param code  the value for PMS_PERMISSION.CODE column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setCode(String code) {
  this.code = code == null ? null : code.trim();
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.STATUS
  * @return  the value of PMS_PERMISSION.STATUS column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public Integer getStatus() {
  return status;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.STATUS
  * @param status  the value for PMS_PERMISSION.STATUS column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setStatus(Integer status) {
  this.status = status;
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.ACTION_URL
  * @return  the value of PMS_PERMISSION.ACTION_URL column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public String getActionURL() {
  return actionURL;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.ACTION_URL
  * @param actionURL  the value for PMS_PERMISSION.ACTION_URL column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setActionURL(String actionURL) {
  this.actionURL = actionURL == null ? null : actionURL.trim();
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.MENU_LEVEL
  * @return  the value of PMS_PERMISSION.MENU_LEVEL column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public Integer getMenuLevel() {
  return menuLevel;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.MENU_LEVEL
  * @param menuLevel  the value for PMS_PERMISSION.MENU_LEVEL column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setMenuLevel(Integer menuLevel) {
  this.menuLevel = menuLevel;
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.PARENT_ID
  * @return  the value of PMS_PERMISSION.PARENT_ID column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public Long getParentId() {
  return parentId;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.PARENT_ID
  * @param parentId  the value for PMS_PERMISSION.PARENT_ID column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setParentId(Long parentId) {
  this.parentId = parentId;
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.CREATE_DATE
  * @return  the value of PMS_PERMISSION.CREATE_DATE column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public Date getCreateDate() {
  return createDate;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.CREATE_DATE
  * @param createDate  the value for PMS_PERMISSION.CREATE_DATE column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setCreateDate(Date createDate) {
  this.createDate = createDate;
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.UPDATE_DATE
  * @return  the value of PMS_PERMISSION.UPDATE_DATE column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public Date getUpdateDate() {
  return updateDate;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.UPDATE_DATE
  * @param updateDate  the value for PMS_PERMISSION.UPDATE_DATE column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setUpdateDate(Date updateDate) {
  this.updateDate = updateDate;
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.IS_MENU
  * @return  the value of PMS_PERMISSION.IS_MENU column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public Integer getIsMenu() {
  return isMenu;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.IS_MENU
  * @param isMenu  the value for PMS_PERMISSION.IS_MENU column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setIsMenu(Integer isMenu) {
  this.isMenu = isMenu;
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.SORT
  * @return  the value of PMS_PERMISSION.SORT column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public Long getSort() {
  return sort;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.SORT
  * @param sort  the value for PMS_PERMISSION.SORT column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setSort(Long sort) {
  this.sort = sort;
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.PERMISSION_COMMENT
  * @return  the value of PMS_PERMISSION.PERMISSION_COMMENT column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public String getPermissionComment() {
  return permissionComment;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.PERMISSION_COMMENT
  * @param permissionComment  the value for PMS_PERMISSION.PERMISSION_COMMENT column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setPermissionComment(String permissionComment) {
  this.permissionComment = permissionComment == null ? null
    : permissionComment.trim();
 }

 /**
  * This method returns the value of the database column PMS_PERMISSION.IS_MENU_SHOW
  * @return  the value of PMS_PERMISSION.IS_MENU_SHOW column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public Integer getIsMenuShow() {
  return isMenuShow;
 }

 /**
  * This method sets the value of the database column PMS_PERMISSION.IS_MENU_SHOW
  * @param isMenuShow  the value for PMS_PERMISSION.IS_MENU_SHOW column comments null
  * @ibatorgenerated  Mon May 19 17:13:06 CST 2014
  */
 public void setIsMenuShow(Integer isMenuShow) {
  this.isMenuShow = isMenuShow;
 }
 
 重写equals方法
 @Override
 public boolean equals(Object obj) {
  if (obj != null && obj instanceof PermissionDO) {
    PermissionDO permissionDO = (PermissionDO)obj;
   if (this.getCode() != null && permissionDO.getCode() != null) {
    return this.getCode().equals(permissionDO.getCode());
   }else{
    return false;
   }
  }
  return false;
 }

 

public static void main(String[] args) {
  List<PermissionDO> permissionDOs = new ArrayList<PermissionDO>();
  for (Long permissionId : ContainerConstant.PERMISSION_MAP.keySet()) {
   PermissionDO permissionDO = ContainerConstant.PERMISSION_MAP.get(permissionId);
   if (!permissionDOs.contains(permissionDO)) {
    permissionDOs.add(permissionDO);
   }
  }
 }
}

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值