Commit 6dc36fb0 authored by Mathieu Gicquel's avatar Mathieu Gicquel
Browse files

Implements methods archive putInTrash restore - Fix #23

parent 6a67202a
......@@ -142,18 +142,29 @@ public abstract class AbstractProject extends AbstractServerObject implements IP
}
@Override
public final void archive() {
//TODO
public final void archive() throws IllegalStateException {
if(this.isArchived) throw new IllegalStateException("cannot archive an archived task");
this.getTasksList().forEach(ITask::archive);
this.setArchived(true);
}
@Override
public final void putInTrash() {
//TODO
public final void putInTrash() throws IllegalStateException {
if(this.isTrash()) throw new IllegalStateException("cannot trash a trashed project");
this.setTrash(true);
this.getTasksList().forEach(ITask::putInTrash);
}
@Override
public final void restore() {
//TODO
public final void restore() throws IllegalStateException {
if(!this.isTrash()) throw new IllegalStateException("cannot restore a not trashed project");
this.setTrash(false);
this.getTasksList().forEach(ITask::restore);
}
@Override
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment