package solutions.digamma.damas.content;

import solutions.digamma.damas.DocumentException;
import solutions.digamma.damas.Entity;
import solutions.digamma.damas.inspection.Nonnull;
import solutions.digamma.damas.inspection.Nullable;

import javax.xml.bind.annotation.XmlTransient;

/**
 * File object. A generalization of a documents and folders.
 *
 * @author Ahmad Shahwan
 */
public interface File extends Entity {

    /**
     * A value returned by {@code getParent()} when the file is root.
     */
    Folder NO_PARENT = null;

    /**
     * A value returned by {@code getParentId()} when the file is root.
     */
    String NO_PARENT_ID = new String();

    /**
     * File name.
     *
     * @return
     */
    @Nullable String getName() throws DocumentException;

    /**
     * Set file's name.
     *
     * @param value
     */
    void setName(@Nonnull String value) throws DocumentException;

    /**
     * Parent folder.
     *
     * @return
     */
    @Nullable Folder getParent() throws DocumentException;

    /**
     * Set file's parent folder.
     *
     * @param value
     */
    void setParent(@Nonnull Folder value) throws DocumentException;

    /**
     * Parent ID.
     *
     * @return
     */
    String getParentId() throws DocumentException;

    /**
     * Set parent ID.
     *
     * @param value
     */
    void setParentId(String value) throws DocumentException;

    /**
     * Expand file into its detailed counterpart.
     *
     * @return
     * @throws DocumentException
     */
    @Nonnull DetailedFile expand() throws DocumentException;

    /**
     * Update file with file information.
     *
     * @param other
     * @throws DocumentException
     */
    default void update(@Nonnull File other) throws DocumentException {
        if (other.getName() != null) {
            this.setName(other.getName());
        }
        if (other.getParentId() != null) {
            this.setParentId(other.getParentId());
        }
    }

    /**
     * Whether file is root.
     *
     * @return
     * @throws DocumentException
     */
    @XmlTransient
    default boolean isRoot() throws DocumentException {
        return getParentId() == NO_PARENT_ID;
    }
}

@@ -232,56 +232,8 @@
 e;%0A%0A
-import javax.xml.bind.annotation.XmlTransient;%0A%0A
 /**%0A
@@ -1936,234 +1936,7 @@
    %7D
-%0A%0A    /**%0A     * Whether file is root.%0A     *%0A     * @return%0A     * @throws DocumentException%0A     */%0A    @XmlTransient%0A    default boolean isRoot() throws DocumentException %7B%0A        return getParentId() == NO_PARENT_ID;%0A    %7D
 %0A%7D%0A

Remove unneccessary default method.