Created
April 23, 2018 02:52
-
-
Save ItsDoot/07c39137ce3d3cef819a3d40a67a24e5 to your computer and use it in GitHub Desktop.
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
shared abstract class UserStatus of online | idle | doNotDisturb | invisible | offline { | |
shared static UserStatus|ParseException parse(String string) => | |
parseUserStatus(string) else ParseException("illegal format for UserStatus"); | |
shared new () {} | |
} | |
"A value representing online status for a [[User]]." | |
shared object online extends UserStatus() { | |
string => "online"; | |
} | |
"A value representing idle status for a [[User]]." | |
shared object idle extends UserStatus() { | |
string => "idle"; | |
} | |
"A value representing do-not-disturb status for a [[User]]." | |
shared object doNotDisturb extends UserStatus() { | |
string => "dnd"; | |
} | |
"A value representing invisible status for a [[User]]." | |
shared object invisible extends UserStatus() { | |
string => "invisible"; | |
} | |
"A value representing offline status for a [[User]]." | |
shared object offline extends UserStatus() { | |
string => "offline"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment