Commit 09fece05 authored by Pronier Julien's avatar Pronier Julien
parents b1f2e10a 554eb658
Pipeline #2876 canceled with stages
......@@ -2,3 +2,4 @@ target
org.eclipse.*
.project
.classpath
.factorypath
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
......@@ -21,6 +22,15 @@
<version>5.9.2</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
......
......@@ -3,6 +3,9 @@ package imt;
public class Application {
public static void main(String[] args) {
System.out.println("Hello World!");
var chef = new Chef(1, "Caca", "Pipi", "DQSQFQSF", Genre.HOMME, 3, Specialite.CUISINIER);
var padawan = new Padawan(1, "Hazebrouck", "Antoine", "06 51 73 08 05", Genre.HOMME, chef);
System.out.println(padawan);
}
}
package imt;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Data
public class Chef extends Person {
private final int etoiles;
private final Specialite specialite;
public Chef(int id, String nom, String prenom, String telephone, Genre genre, int etoiles, Specialite specialite) {
super(id, nom, prenom, telephone, genre);
this.etoiles = etoiles;
this.specialite = specialite;
}
}
package imt;
public enum Genre {
HOMME,FEMME
}
// package imt;
// import lombok.Data;
// import lombok.EqualsAndHashCode;
// @EqualsAndHashCode(callSuper = true)
// @Data
// public class Jury extends Person {
// // private final int TODO faire les jurys
// public Jury() {
// super(null, null, null, null, null);
// }
// }
// TODO finir quand les Jurys sont finito
\ No newline at end of file
package imt;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Data
public class Padawan extends Person {
private final Chef chef;
public Padawan(int id, String nom, String prenom, String telephone, Genre genre, Chef chef) {
super(id, nom, prenom, telephone, genre);
this.chef = chef;
}
}
package imt;
import lombok.Data;
@Data
public abstract class Person {
private final int id;
private final String nom;
private final String prenom;
private final String telephone;
private final Genre genre;
}
package imt;
public enum Specialite {
CUISINIER, PATISSIER, TRAVAIL_A_DISTANCE
}
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