com.github.jamesnetherton.zulip.client.api.server.WebStreamUnreadsCountDisplayPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zulip-java-client Show documentation
Show all versions of zulip-java-client Show documentation
Java client for the Zulip REST API
The newest version!
package com.github.jamesnetherton.zulip.client.api.server;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* Defines the web stream unread count display policy.
*
* See https://zulip.com/api/update-realm-user-settings-defaults#parameter-web_stream_unreads_count_display_policy
*/
public enum WebStreamUnreadsCountDisplayPolicy {
ALL_STREAMS(1),
UNMUTED_STREAMS_TOPICS(2),
NO_STREAMS(3);
private final int id;
WebStreamUnreadsCountDisplayPolicy(int id) {
this.id = id;
}
public int getId() {
return id;
}
@JsonCreator
public static WebStreamUnreadsCountDisplayPolicy fromInt(int webStreamUnreadsCountDisplayPolicy) {
for (WebStreamUnreadsCountDisplayPolicy policy : WebStreamUnreadsCountDisplayPolicy.values()) {
if (policy.getId() == webStreamUnreadsCountDisplayPolicy) {
return policy;
}
}
return ALL_STREAMS;
}
}