forked from ringcentral/pubnub-jtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36acd34
commit e53b5e3
Showing
3 changed files
with
90 additions
and
10 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/com/pubnub/api/models/consumer/history/HistoryMessageType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.pubnub.api.models.consumer.history; | ||
|
||
import com.pubnub.api.PubNubException; | ||
|
||
public enum HistoryMessageType { | ||
Message, | ||
File; | ||
|
||
private static final int TYPE_MESSAGE = 0; | ||
private static final int TYPE_FILE = 4; | ||
|
||
public static HistoryMessageType of(Integer messageType) throws PubNubException { | ||
if (messageType == null) { | ||
return Message; | ||
} | ||
switch (messageType) { | ||
case TYPE_MESSAGE: return Message; | ||
case TYPE_FILE: return File; | ||
default: throw new PubNubException("Unknown message type value $value", null, null, null, 0, null, null); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters