@@ -33,7 +33,7 @@ public class ValidateRoomService {
3333 public void validateUserStatusIsActive (Long userId ) {
3434 Optional <User > checkUserStatusIsActive = userRepository .findByIdAndStatus (userId , ACTIVE );
3535
36- if (! checkUserStatusIsActive .isPresent ()) {
36+ if (checkUserStatusIsActive .isEmpty ()) {
3737 throw new BussinessException (BAD_REQUEST );
3838 }
3939 }
@@ -55,15 +55,15 @@ public User validateUserIsExist(Long userId) {
5555 public void validateRoomIsExist (Long roomId ) {
5656 Optional <Room > checkRoomIsExist = roomRepository .findById (roomId );
5757
58- if (! checkRoomIsExist .isPresent ()) {
58+ if (checkRoomIsExist .isEmpty ()) {
5959 throw new BussinessException (BAD_REQUEST );
6060 }
6161 }
6262
6363 public void validateRoomStatusIsWait (Long roomId ) {
6464 Optional <Room > checkRoomStatusIsWait = roomRepository .findByIdAndStatus (roomId , WAIT );
6565
66- if (! checkRoomStatusIsWait .isPresent ()) {
66+ if (checkRoomStatusIsWait .isEmpty ()) {
6767 throw new BussinessException (BAD_REQUEST );
6868 }
6969 }
@@ -107,7 +107,7 @@ public void validateHostOfRoom(Long roomId, Long userId) {
107107 public void validateUserIsInRoom (Long roomId , Long userId ) {
108108 Optional <UserRoom > checkUserParticipate = userRoomRepository .findByRoomId_IdAndUserId_Id (roomId , userId );
109109
110- if (! checkUserParticipate .isPresent ()) {
110+ if (checkUserParticipate .isEmpty ()) {
111111 throw new BussinessException (BAD_REQUEST );
112112 }
113113 }
0 commit comments