com.queue_it.connector.CancelMultipleWaitingRoomHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of connector Show documentation
Show all versions of connector Show documentation
SDK for integrating your application with Queue-it
The newest version!
package com.queue_it.connector;
import java.util.List;
import java.util.Map;
public class CancelMultipleWaitingRoomHelper {
public static final char WAITING_ROOM_WITH_QUEUE_ID_SEPARATOR = '~';
public static final char WAITING_ROOM_QUEUE_ID_PAIR_SEPARATOR = '_';
private CancelMultipleWaitingRoomHelper() {
}
public static String getCancelUriPath(List> waitingRoomIdWithQueueIdList) {
if (waitingRoomIdWithQueueIdList == null) {
throw new IllegalArgumentException();
}
if (waitingRoomIdWithQueueIdList.isEmpty()) {
throw new IllegalStateException();
}
StringBuilder waitingRoomWithQueueIdList = new StringBuilder();
for (Map.Entry waitingRoomIdWithQueueId : waitingRoomIdWithQueueIdList) {
waitingRoomWithQueueIdList.append(waitingRoomIdWithQueueId.getKey());
if (!Utils.isNullOrWhiteSpace(waitingRoomIdWithQueueId.getValue())) {
waitingRoomWithQueueIdList.append(CancelMultipleWaitingRoomHelper.WAITING_ROOM_WITH_QUEUE_ID_SEPARATOR);
waitingRoomWithQueueIdList.append(waitingRoomIdWithQueueId.getValue());
}
waitingRoomWithQueueIdList.append(CancelMultipleWaitingRoomHelper.WAITING_ROOM_QUEUE_ID_PAIR_SEPARATOR);
}
waitingRoomWithQueueIdList.deleteCharAt(waitingRoomWithQueueIdList.length() - 1);
return waitingRoomWithQueueIdList.toString();
}
}