package org.gcube.portlets.user.workspace.client.model; import java.util.Date; import org.gcube.portlets.user.workspace.client.ConstantsExplorer; /** * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it * */ public class FileGridModel extends FileModel { /** * */ private static final long serialVersionUID = 1L; protected FileGridModel(){ } public FileGridModel(String identifier, String name, String path, Date creationDate, FileModel parent, long size, boolean isDirectory, boolean isShared) { super(identifier, name, parent, isDirectory, isShared); setCreationDate(creationDate); setSize(size); } public FileGridModel(String identifier, String name, Date creationDate, FileModel parent, long size, boolean isDirectory, boolean isShared) { super(identifier, name, parent, isDirectory, isShared); setCreationDate(creationDate); setSize(size); } private void setSize(long size) { set(ConstantsExplorer.SIZE, size); } public long getSize() { return (Long) get(ConstantsExplorer.SIZE); } private void setCreationDate(Date creationDate) { set(ConstantsExplorer.GRIDCOLUMNCREATIONDATE, creationDate); } public Date getCreationDate(){ return (Date) get(ConstantsExplorer.GRIDCOLUMNCREATIONDATE); } @Override public boolean equals(Object obj) { if (obj != null && obj instanceof FileGridModel) { FileGridModel mobj = (FileGridModel) obj; return getIdentifier().equals(mobj.getIdentifier()); } return super.equals(obj); } }