@Override public User newUser( String id ) { return new UserImpl(id); }
@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( obj == null ) return false; if ( !(obj instanceof CommentImpl) ) return false; CommentImpl other = (CommentImpl) obj; if ( addedBy == null ) { if ( other.addedBy != null ) return false; } else if ( !addedBy.equals( other.addedBy ) ) return false; if ( addedAt == null ) { if ( other.addedAt != null ) return false; } else if ( addedAt.getTime() != other.addedAt.getTime() ) return false; if ( text == null ) { if ( other.text != null ) return false; } else if ( !text.equals( other.text ) ) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addedBy == null) ? 0 : addedBy.hashCode()); result = prime * result + ((addedAt == null) ? 0 : addedAt.hashCode()); result = prime * result + ((text == null) ? 0 : text.hashCode()); return result; }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { id = in.readLong(); text = in.readUTF(); addedBy = new UserImpl(); addedBy.readExternal( in ); addedAt = new Date( in.readLong() ); }
public void writeExternal(ObjectOutput out) throws IOException { out.writeLong( id ); if( text == null ) { text = ""; } out.writeUTF( text ); // There are no guarantees that addedBy is not null = potential bug addedBy.writeExternal( out ); long addedAtTime = 0; if( addedAt != null ) { addedAtTime = addedAt.getTime(); } out.writeLong( addedAtTime ); }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { id = in.readLong(); name = in.readUTF(); accessType = AccessType.valueOf( in.readUTF() ); contentType = in.readUTF(); attachedBy = new UserImpl(); attachedBy.readExternal( in ); attachedAt = new Date( in.readLong() ); size = in.readInt( ); attachmentContentId = in.readLong(); }
public void writeExternal(ObjectOutput out) throws IOException { out.writeLong( id ); if( name == null ) { name = ""; } out.writeUTF( name ); out.writeUTF( accessType.toString() ); if( contentType == null ) { contentType = ""; } out.writeUTF( contentType ); // There are no guarantees that attachedBy is not null == potential bug attachedBy.writeExternal( out ); long attachedAtTime = 0; if( attachedAt != null ) { attachedAtTime = attachedAt.getTime(); } out.writeLong( attachedAtTime ); out.writeInt( size ); out.writeLong( attachmentContentId ); }
@Override public User newUser() { return new UserImpl(); }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { if ( in.readBoolean() ) { taskInitiator = new UserImpl(); taskInitiator.readExternal( in ); } potentialOwners = CollectionUtils.readOrganizationalEntityList( in ); excludedOwners = CollectionUtils.readOrganizationalEntityList( in ); taskStakeholders = CollectionUtils.readOrganizationalEntityList( in ); businessAdministrators = CollectionUtils.readOrganizationalEntityList( in ); recipients = CollectionUtils.readOrganizationalEntityList( in ); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((accessType == null) ? 0 : accessType.hashCode()); result = prime * result + ((attachedAt == null) ? 0 : attachedAt.hashCode()); result = prime * result + ((attachedBy == null) ? 0 : attachedBy.hashCode()); result = prime * result + size; result = prime * result + (int) (attachmentContentId ^ (attachmentContentId >>> 32)); result = prime * result + ((contentType == null) ? 0 : contentType.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; }
public void writeExternal(ObjectOutput out) throws IOException { if ( taskInitiator != null ) { out.writeBoolean( true ); taskInitiator.writeExternal( out ); } else { out.writeBoolean( false ); } CollectionUtils.writeOrganizationalEntityList( potentialOwners, out ); CollectionUtils.writeOrganizationalEntityList( excludedOwners, out ); CollectionUtils.writeOrganizationalEntityList( taskStakeholders, out ); CollectionUtils.writeOrganizationalEntityList( businessAdministrators, out ); CollectionUtils.writeOrganizationalEntityList( recipients, out ); }
@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( obj == null ) return false; if ( !(obj instanceof AttachmentImpl) ) return false; AttachmentImpl other = (AttachmentImpl) obj; if ( accessType == null ) { if ( other.accessType != null ) return false; } else if ( !accessType.equals( other.accessType ) ) return false; if ( attachedAt == null ) { if ( other.attachedAt != null ) return false; } else if ( attachedAt.getTime() != other.attachedAt.getTime() ) return false; if ( attachedBy == null ) { if ( other.attachedBy != null ) return false; } else if ( !attachedBy.equals( other.attachedBy ) ) return false; if ( size != other.size ) return false; if ( attachmentContentId != other.attachmentContentId ) return false; if ( contentType == null ) { if ( other.contentType != null ) return false; } else if ( !contentType.equals( other.contentType ) ) return false; if ( name == null ) { if ( other.name != null ) return false; } else if ( !name.equals( other.name ) ) return false; return true; }
static UserImpl convertToUserImpl(User user) { if( user == null ) { return null; } if( user instanceof UserImpl ) { return (UserImpl) user; } else { return new UserImpl(user.getId()); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { id = in.readLong(); text = in.readUTF(); addedBy = new UserImpl(); addedBy.readExternal( in ); addedAt = new Date( in.readLong() ); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + CollectionUtils.hashCode( businessAdministrators ); result = prime * result + CollectionUtils.hashCode( excludedOwners ); result = prime * result + ((potentialOwners == null) ? 0 : CollectionUtils.hashCode( potentialOwners )); result = prime * result + CollectionUtils.hashCode( recipients ); result = prime * result + ((taskInitiator == null) ? 0 : taskInitiator.hashCode()); result = prime * result + CollectionUtils.hashCode( taskStakeholders ); return result; }
public void writeExternal(ObjectOutput out) throws IOException { out.writeLong( id ); if( text == null ) { text = ""; } out.writeUTF( text ); // There are no guarantees that addedBy is not null = potential bug addedBy.writeExternal( out ); long addedAtTime = 0; if( addedAt != null ) { addedAtTime = addedAt.getTime(); } out.writeLong( addedAtTime ); }
@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( obj == null ) return false; if ( !(obj instanceof PeopleAssignmentsImpl) ) return false; PeopleAssignmentsImpl other = (PeopleAssignmentsImpl) obj; if ( taskInitiator == null ) { if ( other.taskInitiator != null ) return false; } else if ( !taskInitiator.equals( other.taskInitiator ) ) return false; return CollectionUtils.equals( businessAdministrators, other.businessAdministrators ) && CollectionUtils.equals( excludedOwners, other.excludedOwners ) && CollectionUtils.equals( potentialOwners, other.potentialOwners ) && CollectionUtils.equals( recipients, other.recipients ) && CollectionUtils.equals( taskStakeholders, other.taskStakeholders ); }
public TaskFluent setAdminUser(String userId) { if(assignments.getBusinessAdministrators().isEmpty()){ List<OrganizationalEntity> businessAdmins = new ArrayList<OrganizationalEntity>(); assignments.setBusinessAdministrators(businessAdmins); } assignments.getBusinessAdministrators().add(new UserImpl(userId)); return this; }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { id = in.readLong(); name = in.readUTF(); accessType = AccessType.valueOf( in.readUTF() ); contentType = in.readUTF(); attachedBy = new UserImpl(); attachedBy.readExternal( in ); attachedAt = new Date( in.readLong() ); size = in.readInt( ); attachmentContentId = in.readLong(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addedBy == null) ? 0 : addedBy.hashCode()); result = prime * result + ((addedAt == null) ? 0 : addedAt.hashCode()); result = prime * result + ((text == null) ? 0 : text.hashCode()); return result; }