forked from pierront/mylibrary-template
exceptionavis
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package fr.iut_fbleau.but3.dev62.mylibrary.avis.entity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.UUID;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
public class Avis {
|
||||
private UUID id;
|
||||
private UUID clientId;
|
||||
private UUID livreId;
|
||||
private int note;
|
||||
private String commentaire;
|
||||
private LocalDate dateAchat;
|
||||
|
||||
public void setRandomUUID() {
|
||||
this.id = UUID.randomUUID();
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package fr.iut_fbleau.but3.dev62.mylibrary.avis.exception;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
public class AvisNotFoundException extends Exception {
|
||||
|
||||
public static final String THE_AVIS_WITH_ID_DOES_NOT_EXIST_MESSAGE = "The avis with id {0} does not exist";
|
||||
|
||||
public AvisNotFoundException(UUID uuid) {
|
||||
super(MessageFormat.format(THE_AVIS_WITH_ID_DOES_NOT_EXIST_MESSAGE, uuid));
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package fr.iut_fbleau.but3.dev62.mylibrary.avis.exception;
|
||||
|
||||
public class NotValidAvisException extends Exception {
|
||||
|
||||
public NotValidAvisException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user