/** * Method equals * * @param other */ public boolean equals(Object other) { if ( this == other) { return true; } if ( !(other instanceof Individual) ) { return false; } Individual that = (Individual) other; boolean result = true; result = result && ( getEmail() == null ? that.getEmail() == null : getEmail().equals( that.getEmail() ) ); return result; } //-- boolean equals(Object)
/** * Method addProperty * * @param key * @param value */ public void addProperty(String key, String value) { getProperties().put( key, value ); } //-- void addProperty(String, String)
public static List cloneIndividuals( List individuals ) { if ( individuals == null ) { return individuals; } List ret = new ArrayList(); Iterator it = individuals.iterator(); while ( it.hasNext() ) { Individual individual = (Individual) it.next(); Individual cloned = new Individual(); cloned.setPrincipal( individual.getPrincipal() ); cloned.setEmail( individual.getEmail() ); cloned.setName( individual.getName() ); cloned.setOrganization( individual.getOrganization() ); cloned.setOrganizationUrl( individual.getOrganizationUrl() ); cloned.setUrl( individual.getUrl() ); cloned.setTimezone( individual.getTimezone() ); cloned.setRoles( cloneRoles( individual.getRoles() ) ); cloned.setProperties( clone( individual.getProperties() ) ); ret.add( cloned ); } return ret; }
/** * Method addRole * * @param string */ public void addRole(String string) { if ( !(string instanceof String) ) { throw new ClassCastException( "Individual.addRoles(string) parameter must be instanceof " + String.class.getName() ); } getRoles().add( string ); } //-- void addRole(String)
/** * Method removeRole * * @param string */ public void removeRole(String string) { if ( !(string instanceof String) ) { throw new ClassCastException( "Individual.removeRoles(string) parameter must be instanceof " + String.class.getName() ); } getRoles().remove( string ); } //-- void removeRole(String)
/** * Method toString */ public java.lang.String toString() { StringBuffer buf = new StringBuffer(); buf.append( "email = '" ); buf.append( getEmail() + "'" ); return buf.toString(); } //-- java.lang.String toString()