package com.xiaozhi.blog.vo;
import java.io.Serializable;
import java.util.List;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection="usergroup")
public class UserGroup implements Serializable{
@Id
private String groupId;//组id
private String ownerId;//用户组所属用户
private String groupName;//组名
private List<String> uids;//组成员id集合
private int orderBy;//组排序字段
@Transient
private boolean selected;
public String getOwnerId() {
return ownerId;
}
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public List<String> getUids() {
return uids;
}
public void setUids(List<String> uids) {
this.uids = uids;
}
public int getOrderBy() {
return orderBy;
}
public void setOrderBy(int orderBy) {
this.orderBy = orderBy;
}
public boolean getSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((groupId == null) ? 0 : groupId.hashCode());
result = prime * result
+ ((groupName == null) ? 0 : groupName.hashCode());
result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
UserGroup other = (UserGroup) obj;
if (groupId == null) {
if (other.groupId != null)
return false;
} else if (!groupId.equals(other.groupId))
return false;
if (groupName == null) {
if (other.groupName != null)
return false;
} else if (!groupName.equals(other.groupName))
return false;
if (ownerId == null) {
if (other.ownerId != null)
return false;
} else if (!ownerId.equals(other.ownerId))
return false;
return true;
}
@Override
public String toString() {
return "UserGroup [groupId=" + groupId + ", ownerId=" + ownerId
+ ", groupName=" + groupName + ", uids=" + uids + ", orderBy="
+ orderBy + ", selected=" + selected + "]";
}
}