RepositoryFile implements Comparable<RepositoryFile>, Serializable { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } RepositoryFile other = (RepositoryFile) obj; if ( id == null ) { if ( other.id != null ) { return false; } else if ( this.path != null ) { if ( !other.path.equals( this.path ) ) { return false; } } } else if ( !id.equals( other.id ) ) { return false; } if ( locale == null ) { if ( other.locale != null ) { return false; } } else if ( !locale.equals( other.locale ) ) { return false; } if ( versionId == null ) { if ( other.versionId != null ) { return false; } } else if ( !versionId.equals( other.versionId ) ) { return false; } return true; } RepositoryFile( Serializable id, String name, boolean folder, Boolean hidden, Boolean schedulable,
      boolean versioned,
      Serializable versionId, String path, Date createdDate, Date lastModifiedDate, boolean locked, String lockOwner,
      String lockMessage, Date lockDate, String locale, String title, String description,
      String originalParentFolderPath, Date deletedDate, long fileSize, String creatorId,
      Map<String, Properties> localePropertiesMap, boolean aclNode );  RepositoryFile( Serializable id, String name, boolean folder, Boolean hidden, Boolean schedulable,
      boolean versioned,
      Serializable versionId, String path, Date createdDate, Date lastModifiedDate, boolean locked, String lockOwner,
      String lockMessage, Date lockDate, String locale, String title, String description,
      String originalParentFolderPath, Date deletedDate, long fileSize, String creatorId,
      Map<String, Properties> localePropertiesMap ); @Deprecated  RepositoryFile( Serializable id, String name, boolean folder, Boolean hidden, boolean versioned,
      Serializable versionId, String path, Date createdDate, Date lastModifiedDate, boolean locked, String lockOwner,
      String lockMessage, Date lockDate, String locale, String title, String description,
      String originalParentFolderPath, Date deletedDate, long fileSize, String creatorId,
      Map<String, Properties> localePropertiesMap ); String getName(); Serializable getId(); Date getCreatedDate(); String getCreatorId(); Date getLastModifiedDate(); Long getFileSize(); boolean isFolder(); String getPath(); Boolean isHidden(); Boolean isSchedulable(); boolean isVersioned(); Serializable getVersionId(); boolean isLocked(); String getLockOwner(); String getLockMessage(); Date getLockDate(); String getTitle(); String getDescription(); Map<String, Properties> getLocalePropertiesMap(); String getLocale(); String getOriginalParentFolderPath(); Date getDeletedDate(); boolean isAclNode(); @Override String toString(); @Override int compareTo( final RepositoryFile other ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override RepositoryFile clone(); static final String SEPARATOR; static final String DEFAULT_LOCALE; static final String ROOT_LOCALE; static final String TITLE; static final String FILE_TITLE; static final String DESCRIPTION; static final String FILE_DESCRIPTION; static final boolean HIDDEN_BY_DEFAULT; static final boolean SCHEDULABLE_BY_DEFAULT; static final String HIDDEN_KEY; static final String SCHEDULABLE_KEY; }
@Test public void testEquals() { RepositoryFile dupFile = file.clone(); assertTrue( file.equals( dupFile ) ); assertTrue( file.equals( file ) ); assertFalse( file.equals( null ) ); RepositoryFile.Builder builder = new RepositoryFile.Builder( file ); builder.versionId( "diffVersionId" ); RepositoryFile newFile = builder.build(); assertFalse( newFile.equals( file ) ); builder.versionId( null ); newFile = builder.build(); assertFalse( newFile.equals( file ) ); RepositoryFile secondNewFile = builder.build(); assertTrue( newFile.equals( secondNewFile ) ); builder.locale( "diffLocale" ); newFile = builder.build(); assertFalse( newFile.equals( file ) ); builder.locale( null ); newFile = builder.build(); assertFalse( newFile.equals( file ) ); secondNewFile = builder.build(); assertTrue( newFile.equals( secondNewFile ) ); builder.id( "diffId" ); newFile = builder.build(); assertFalse( newFile.equals( file ) ); builder.id( null ); newFile = builder.build(); assertFalse( newFile.equals( file ) ); secondNewFile = builder.build(); assertTrue( newFile.equals( secondNewFile ) ); builder.path( "diffPath" ); secondNewFile = builder.build(); assertFalse( newFile.equals( secondNewFile ) ); }