Skip to content
Snippets Groups Projects
Commit 578ce8ec authored by Christopher Seitz's avatar Christopher Seitz
Browse files

PreparationNoteCommand, PreparationNoteService, RoomCommand, RoomService

parent 727289c1
No related branches found
No related tags found
No related merge requests found
...@@ -5,18 +5,18 @@ import java.util.Objects; ...@@ -5,18 +5,18 @@ import java.util.Objects;
import java.util.Objects; import java.util.Objects;
public class PreparationNote { public class PreparationNote {
private String noteId; private String noteId; // Eindeutige Identifikation der Notiz
private String operationId; private String operationId; // ID der zugehörigen Operation
private String content; private String content; // Inhalt der Notiz
// Konstruktor zur Initialisierung der Notiz-Attribute
public PreparationNote(String noteId, String operationId, String content) { public PreparationNote(String noteId, String operationId, String content) {
this.noteId = noteId; this.noteId = noteId;
this.operationId = operationId; this.operationId = operationId;
this.content = content; this.content = content;
} }
// Getter und Setter Methoden für die Attribute
public String getId() { public String getId() {
return noteId; return noteId;
} }
...@@ -41,7 +41,7 @@ public class PreparationNote { ...@@ -41,7 +41,7 @@ public class PreparationNote {
this.content = content; this.content = content;
} }
// toString Methode zur Darstellung der Notiz als String
@Override @Override
public String toString() { public String toString() {
return "PreparationNote{" + return "PreparationNote{" +
...@@ -51,7 +51,7 @@ public class PreparationNote { ...@@ -51,7 +51,7 @@ public class PreparationNote {
'}'; '}';
} }
// equals Methode zum Vergleichen von zwei PreparationNote Objekten
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
...@@ -61,7 +61,7 @@ public class PreparationNote { ...@@ -61,7 +61,7 @@ public class PreparationNote {
Objects.equals(operationId, that.operationId) && Objects.equals(operationId, that.operationId) &&
Objects.equals(content, that.content); Objects.equals(content, that.content);
} }
// hashCode Methode zur Berechnung des Hashcodes eines PreparationNote Objekts
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(noteId, operationId, content); return Objects.hash(noteId, operationId, content);
......
public class PreparationNoteCommand {
private String operationId;
private String content;
// Konstruktor zur Initialisierung der Command-Attribute
public PreparationNoteCommand(String operationId, String content) {
this.operationId = operationId;
this.content = content;
}
// Getter und Setter Methoden für die Attribute
public String getOperationId() {
return operationId;
}
public void setOperationId(String operationId) {
this.operationId = operationId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
import java.util.List;
public interface PreparationNoteService {
PreparationNote createNote(PreparationNoteCommand command); // Methode zum Erstellen einer neuen Notiz
PreparationNote updateNote(String noteId, PreparationNoteCommand command); // Methode zum Aktualisieren einer Notiz
void deleteNote(String noteId); // Methode zum Löschen einer Notiz
PreparationNote getNoteById(String noteId); // Methode zum Abrufen einer Notiz nach ID
List<PreparationNote> getNotesByOperationId(String operationId); // Methode zum Abrufen von Notizen nach Operation-ID
}
...@@ -2,18 +2,18 @@ import java.time.Instant; ...@@ -2,18 +2,18 @@ import java.time.Instant;
import java.util.Objects; import java.util.Objects;
public class Room { public class Room {
private String roomId; private String roomId; // Eindeutige Identifikation des Raum
private String roomName; private String roomName;// Name des Raums
private int capacity; private int capacity; // Kapazität des Raums
// Konstruktor zur Initialisierung der Raum-Attribute
public Room(String RoomId, String roomName, int capacity) { public Room(String RoomId, String roomName, int capacity) {
this.roomId = roomId; this.roomId = roomId;
this.roomName = RoomName; this.roomName = RoomName;
this.capacity = capacity; this.capacity = capacity;
} }
// Getter und Setter Methoden für die Attribute
public String getRoomId() { public String getRoomId() {
return RoomId; return RoomId;
} }
...@@ -38,7 +38,7 @@ public class Room { ...@@ -38,7 +38,7 @@ public class Room {
this.capacity = capacity; this.capacity = capacity;
} }
// toString Methode zur Darstellung des Raums als String
@Override @Override
public String toString() { public String toString() {
return "Room{" + return "Room{" +
...@@ -48,7 +48,7 @@ public class Room { ...@@ -48,7 +48,7 @@ public class Room {
'}'; '}';
} }
// equals Methode zum Vergleichen von zwei Room Objekten
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
...@@ -58,10 +58,10 @@ public class Room { ...@@ -58,10 +58,10 @@ public class Room {
Objects.equals(roomId, room.roomId) && Objects.equals(roomId, room.roomId) &&
Objects.equals(roomName, room.roomName); Objects.equals(roomName, room.roomName);
} }
// hashCode Methode zur Berechnung des Hashcodes eines Room Objekts
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, name, capacity); return Objects.hash(roomId, roomName, capacity);
} }
} }
......
public class RoomCommand {
private String roomName;
private int capacity;
// Konstruktor zur Initialisierung der Kommando-Attribute
public RoomCommand(String roomName, int capacity) {
this.roomName = roomName;
this.capacity = capacity;
}
// Getter und Setter Methoden für die Attribute
public String getRoomName() {
return roomName;
}
public void setRoomName(String roomName) {
this.roomName = roomName;
}
public int getCapacity() {
return capacity;
}
public void setCapacity(int capacity) {
this.capacity = capacity;
}
}
import java.util.List;
public interface RoomService {
Room createRoom(RoomCommand command); // Methode zum Erstellen eines neuen Raums
Room updateRoom(String roomId, RoomCommand command); // Methode zum Aktualisieren eines Raums
void deleteRoom(String roomId); // Methode zum Löschen eines Raums
Room getRoomById(String roomId); // Methode zum Abrufen eines Raums nach ID
List<Room> getAllRooms(); // Methode zum Abrufen aller Räume
}
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment