Guest User

Untitled

a guest
Feb 19th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. package com.mywonderfulbnb.bnb.definition
  2.  
  3. final class Bnb implements ReadOnlyBnb {
  4. private BnbId bnbId;
  5. private OwnerId ownerId;
  6. private Name name;
  7. private Rooms rooms;
  8.  
  9. public Bnb(BnbId bnbId, OwnerId ownerId, Name name, Rooms rooms) {
  10. this.bnbId = bnbId;
  11. this.ownerId = ownerId;
  12. this.name = name;
  13. this.rooms = rooms;
  14. }
  15.  
  16. public void addRoomByName(RoomName roomName) {
  17. // check if room with that name already exists, then...
  18. room = new Room(roomName);
  19. rooms = rooms.add(room);
  20. }
  21.  
  22. public BnbId getBnbId() {
  23. return bnbId;
  24. }
  25.  
  26. public OwnerId getOwnerId() {
  27. return ownerId;
  28. }
  29.  
  30. public Name getName() {
  31. return name;
  32. }
  33.  
  34. public Rooms getRooms() {
  35. return rooms;
  36. }
  37. }
Add Comment
Please, Sign In to add comment