001: /**
002: * $Id: Community.java,v 1.3 2007/01/26 03:47:53 portalbld Exp $
003: * Copyright 2005 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.community.mc.impl.jdo.pc;
014:
015: import java.io.Serializable;
016: import java.util.HashSet;
017: import java.util.Set;
018:
019: /**
020: * JDO PC Community class.
021: */
022: public class Community implements Serializable {
023: private long communityId;
024: private String communityName;
025: private String description;
026: private String category;
027: private long communityCreationTime;
028: private short isSecure;
029: private short isListed;
030: private short isMembershipRestricted;
031: private Set communityUsers = new HashSet();
032: private Set communityRoles = new HashSet();
033: private Set communityDps = new HashSet();
034:
035: public Community() {
036: }
037:
038: public Community(String communityName) {
039: this .communityName = communityName;
040: }
041:
042: public long getCommunityId() {
043: return communityId;
044: }
045:
046: public String getCommunityName() {
047: return communityName;
048: }
049:
050: public long getCommunityCreationTime() {
051: return communityCreationTime;
052: }
053:
054: public String getDescription() {
055: return description;
056: }
057:
058: public String getCategory() {
059: return category;
060: }
061:
062: public short isMembershipRestricted() {
063: return isMembershipRestricted;
064: }
065:
066: public short isSecure() {
067: return isSecure;
068: }
069:
070: public short isListed() {
071: return isListed;
072: }
073:
074: public void setDescription(String newDescription) {
075: description = newDescription;
076: }
077:
078: public void setCategory(String newCategory) {
079: category = newCategory;
080: }
081:
082: public void setMembershipRestricted(short newIsMembershipRestricted) {
083: isMembershipRestricted = newIsMembershipRestricted;
084: }
085:
086: public void setSecure(short newIsSecure) {
087: isSecure = newIsSecure;
088: }
089:
090: public void setListed(short newIsListed) {
091: isListed = newIsListed;
092: }
093:
094: public void setCommunityCreationTime(long time) {
095: communityCreationTime = time;
096: }
097:
098: public void addCommunityUser(CommunityUser cu) {
099: communityUsers.add(cu);
100: }
101:
102: public void addCommunityRole(CommunityRole cr) {
103: communityRoles.add(cr);
104: }
105:
106: public void setCommunityDp(CommunityDp cdp) {
107: communityDps.add(cdp);
108: }
109:
110: public boolean equals(Object obj) {
111: if (obj == this ) {
112: return true;
113: }
114: if (!(obj instanceof Community)) {
115: return false;
116: }
117: Community other = (Community) obj;
118:
119: return getCommunityName().equals(other.getCommunityName());
120: }
121:
122: public int hashCode() {
123: return getCommunityName().hashCode();
124: }
125:
126: public String toString() {
127: return getCommunityName();
128: }
129: }
|