@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; }
@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 ( accessType != null ) { out.writeBoolean( true ); out.writeUTF( accessType.toString() ); } else { out.writeBoolean( false ); } if ( type != null ) { out.writeBoolean( true ); out.writeUTF( type ); } else { out.writeBoolean( false ); } if ( content != null ) { out.writeBoolean( true ); out.writeInt( content.length ); out.write( content ); } else { out.writeBoolean( false ); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { if (in.readBoolean()) { accessType = AccessType.valueOf(in.readUTF()); } if (in.readBoolean()) { type = in.readUTF(); } if (in.readBoolean()) { content = new byte[ in.readInt() ]; in.readFully( content ); } }
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 readExternal(ObjectInput in) throws IOException, ClassNotFoundException { if (in.readBoolean()) { accessType = AccessType.valueOf(in.readUTF()); } if (in.readBoolean()) { type = in.readUTF(); } if (in.readBoolean()) { content = new byte[ in.readInt() ]; in.readFully( content ); } }
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 ); }
} else if (!documentAccessType.equals(other.documentAccessType)) return false;
@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 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 { if ( accessType != null ) { out.writeBoolean( true ); out.writeUTF( accessType.toString() ); } else { out.writeBoolean( false ); } if ( type != null ) { out.writeBoolean( true ); out.writeUTF( type ); } else { out.writeBoolean( false ); } if ( content != null ) { out.writeBoolean( true ); out.writeInt( content.length ); out.write( content ); } else { out.writeBoolean( false ); } }
@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; }
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 ); }
} else if (!documentAccessType.equals(other.documentAccessType)) return false;