parent
15993499d4
commit
172f1b9923
@ -1,4 +1,22 @@
|
||||
package VeraxFeather.modele.articles.contenus;
|
||||
|
||||
public class Contenu {
|
||||
public abstract class Contenu {
|
||||
protected int id;
|
||||
protected String typeContenu;
|
||||
|
||||
public Contenu(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getTypeContenu() {
|
||||
return this.typeContenu;
|
||||
}
|
||||
|
||||
protected void setTypeContenu(String typeContenu) {
|
||||
this.typeContenu = typeContenu;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
package VeraxFeather.modele.articles.contenus;
|
||||
|
||||
public class ContenuMedia extends Contenu {
|
||||
private String titre;
|
||||
private String lien;
|
||||
|
||||
public ContenuMedia(int id, String titre, String lien) {
|
||||
super(id);
|
||||
this.titre = titre;
|
||||
this.lien = lien;
|
||||
|
||||
setTypeContenu("image");
|
||||
}
|
||||
|
||||
public static ContenuMedia newVideo(int id, String titre, String lien) {
|
||||
ContenuMedia temp = new ContenuMedia(id, titre, lien);
|
||||
temp.setTypeContenu("video");
|
||||
return temp;
|
||||
}
|
||||
|
||||
public String getTitre() {
|
||||
return titre;
|
||||
}
|
||||
|
||||
public String getLien() {
|
||||
return lien;
|
||||
}
|
||||
|
||||
public void setLien(String lien) {
|
||||
this.lien = lien;
|
||||
}
|
||||
|
||||
public void setTitre(String titre) {
|
||||
this.titre = titre;
|
||||
}
|
||||
|
||||
public java.util.Map<String, String> getContenu() {
|
||||
java.util.Map<String, String> contenu = new java.util.HashMap<>();
|
||||
contenu.put("titre", titre);
|
||||
contenu.put("contenu", lien);
|
||||
|
||||
return contenu;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package VeraxFeather.modele.articles.contenus;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ContenuParagraphe extends Contenu {
|
||||
private String titre;
|
||||
private String texte;
|
||||
|
||||
public ContenuParagraphe(int id, String titre, String texte) {
|
||||
super(id);
|
||||
this.titre = titre;
|
||||
this.texte = texte;
|
||||
|
||||
setTypeContenu("paragraphe");
|
||||
}
|
||||
|
||||
public String getTitre() {
|
||||
return titre;
|
||||
}
|
||||
|
||||
public String getTexte() {
|
||||
return texte;
|
||||
}
|
||||
|
||||
public void setTitre(String titre) {
|
||||
this.titre = titre;
|
||||
}
|
||||
|
||||
public void setTexte(String texte) {
|
||||
this.texte = texte;
|
||||
}
|
||||
|
||||
public java.util.Map<String, String> getContenu() {
|
||||
Map<String, String> contenu = new java.util.HashMap<>();
|
||||
contenu.put("titre", titre);
|
||||
contenu.put("contenu", texte);
|
||||
|
||||
return contenu;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue