Unverified Commit bfd4e74a authored by Mathieu Gicquel's avatar Mathieu Gicquel
Browse files

Refactoring : classes extends abstract classes

parent efdb7d1e
......@@ -182,7 +182,7 @@ public abstract class AbstractProject extends AbstractServerObject implements IP
}
@Override
public final void setSubprojectsList(final List<IProject> projectList) {
public void setSubprojectsList(final List<IProject> projectList) {
this.subprojectsList = projectList;
}
......
......@@ -143,4 +143,6 @@ public interface IProject extends IServerObject {
void setArchived(final boolean archived);
MultipleReference<ITask> getTaskReference();
MultipleReference<IProject> getSubprojectReference();
}
package fr.alma.gtd.server.main.donnees;
import fr.alma.gtd.server.core.IContext;
import fr.alma.gtd.server.core.IParticipant;
import fr.alma.gtd.server.core.ITask;
import fr.alma.gtd.server.core.MultipleReference;
import fr.alma.gtd.server.core.*;
import java.util.Date;
public class Context implements IContext {
public class Context extends AbstractContext implements IContext {
private String nom;
private String idServeur;
......@@ -30,41 +27,22 @@ public class Context implements IContext {
return nom;
}
@Override
public void setName(String n) {
nom = n;
}
@Override
public IParticipant getCreator() {
return null;
}
@Override
public void setCreator(IParticipant c) {
}
@Override
public String getServerIdentifier() {
return idServeur;
}
@Override
public void setServerIdentifier(String idServer) {
this.idServeur = idServer;
}
@Override
public Date getLastModificationDate() {
return null;
}
@Override
public void setLastModificationDate(Date lastModificationDate) {
}
public MultipleReference<ITask> getTaskReference() {
return this.tasks;
}
......
package fr.alma.gtd.server.main.donnees;
import fr.alma.gtd.server.core.AbstractIdea;
import fr.alma.gtd.server.core.IIdea;
import fr.alma.gtd.server.core.IParticipant;
import java.util.Date;
public class Idea implements IIdea {
public class Idea extends AbstractIdea implements IIdea {
private String nom;
private String description;
......@@ -30,21 +31,12 @@ public class Idea implements IIdea {
return nom;
}
@Override
public void setName(String n) {
nom = n;
}
@Override
public String getDescription() {
return description;
}
@Override
public void setDescription(String desc) {
description = desc;
}
@Override
public void putInTrash() {
......@@ -60,48 +52,24 @@ public class Idea implements IIdea {
return false;
}
@Override
public void setTrash(boolean isTrash) {
}
@Override
public boolean isArchived() {
return false;
}
@Override
public void setArchived(boolean isArchived) {
}
@Override
public IParticipant getCreator() {
return createur;
}
@Override
public void setCreator(IParticipant c) {
createur = c;
}
@Override
public String getServerIdentifier() {
return idServeur;
}
@Override
public void setServerIdentifier(String idServer) {
this.idServeur = idServer;
}
@Override
public Date getLastModificationDate() {
return null;
}
@Override
public void setLastModificationDate(Date lastModificationDate) {
}
}
......@@ -6,19 +6,21 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class Project implements IProject {
public class Project extends AbstractProject implements IProject {
private String idServeur;
private String nom;
private Progress progress;
private ReferenceToProjects subprojects;
public Project() {
super();
this.subprojects = new ReferenceToProjects();
}
public Project(IProject autre) {
super();
this();
this.idServeur = autre.getServerIdentifier();
this.progress = autre.getProgress();
this.nom = autre.getName();
......@@ -29,109 +31,46 @@ public class Project implements IProject {
return idServeur;
}
@Override
public void setServerIdentifier(String idServer) {
idServer = idServer;
}
@Override
public Date getLastModificationDate() {
return null;
}
@Override
public void setLastModificationDate(Date lastModificationDate) {
}
@Override
public void addTask(ITask t) {
}
@Override
public void deleteTask(ITask t) {
}
@Override
public void deleteAllTasks() {
}
@Override
public void archive() {
}
@Override
public void putInTrash() {
}
@Override
public void restore() {
}
@Override
public String getName() {
return nom;
}
@Override
public void setName(String n) {
nom = n;
}
@Override
public boolean isTrash() {
return false;
}
@Override
public void setTrash(boolean isTrash) {
}
@Override
public Progress getProgress() {
return progress;
}
@Override
public void setProgress(Progress p) {
this.progress = p;
}
@Override
public IContext getDefaultContext() {
return null;
}
@Override
public void setDefaultContext(IContext defaultContext) {
}
@Override
public List<ITask> getTasksList() {
return null;
}
@Override
public void setTasksList(ArrayList<ITask> tasksList) {
}
@Override
public List<IProject> getSubprojectsList() {
return this.subprojects.get();
}
@Override
public void setSubprojectsList(List<IProject> projectList) {
this.subprojects.set(projectList);
public final void setSubprojectsList(final List<IProject> projectList) {
subprojects.set(projectList);
}
@Override
......@@ -139,31 +78,16 @@ public class Project implements IProject {
return null;
}
@Override
public void setParticipantsList(List<IParticipant> participantList) {
}
@Override
public IParticipant getCreator() {
return null;
}
@Override
public void setCreator(IParticipant c) {
}
@Override
public List<IContact> getContactsList() {
return null;
}
@Override
public void setContactsList(List<IContact> contacts) {
}
@Override
public boolean isArchived() {
return false;
......@@ -178,4 +102,9 @@ public class Project implements IProject {
public MultipleReference<ITask> getTaskReference() {
return null;
}
@Override
public MultipleReference<IProject> getSubprojectReference() {
return this.subprojects;
}
}
......@@ -232,4 +232,9 @@ public final class Project extends AbstractProject {
public MultipleReference<ITask> getTaskReference() {
throw new UnsupportedOperationException();
}
@Override
public MultipleReference<IProject> getSubprojectReference() {
throw new UnsupportedOperationException();
}
}
Markdown is supported
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