package Ġli rand . api . dsl . command . types Ċ Ċ import Ġcom . moj ang . b rig ad ier . Message Ċ import Ġcom . moj ang . b rig ad ier . String Reader Ċ import Ġcom . moj ang . b rig ad ier . context . Command Context Ċ import Ġcom . moj ang . b rig ad ier . suggestion . Suggestions Ċ import Ġcom . moj ang . b rig ad ier . suggestion . Suggestions Builder Ċ import Ġli rand . api . dsl . command . types . exceptions . Chat Command Exception Type Ċ import Ġli rand . api . dsl . command . types . exceptions . Chat Command Syntax Exception Ċ import Ġli rand . api . dsl . command . types . extensions . read Un quoted Ċ import Ġnet . md _ 5 . b ungee . api . chat . Trans latable Component Ċ import Ġjava . util . concurrent . Comp letableFuture Ċ Ċ open Ġclass ĠState Type ( Ċ ĉ open Ġval Ġtrue Cases : Ġ() Ġ-> ĠMap < String , ĠMessage ?> Ġ= ĠInstance . true Cases , Ċ ĉ open Ġval Ġfalse Cases : Ġ() Ġ-> ĠMap < String , ĠMessage ?> Ġ= ĠInstance . false Cases , Ċ ĉ open Ġval Ġunknown StateException Type : ĠChat Command Exception Type Ġ= ĠInstance . unknown StateException Type Ċ ) Ġ: ĠWord Type < Boolean > Ġ{ ĊĊ ĉ /** Ċĉ Ġ* ĠReturns Ġa Ġ` true ` Ġif Ġthe Ġstring Ġreturned Ġby Ġthe Ġgiven Ġ[ reader ] Ċĉ Ġ* Ġcorresponds Ġto Ġthe Ġstates Ġfrom Ġthe Ġresult Ġof Ġthe Ġ[ true Cases ] Ċĉ Ġ* Ġor Ġ` false ` Ġif Ġit Ġcorresponds Ġto Ġthe Ġstates Ġfrom Ġthe Ġresult Ġof Ġthe Ġ[ false Cases ]. Ċĉ Ġ* Ċĉ Ġ* Ġ@ param Ġreader Ġthe Ġreader Ċĉ Ġ* Ġ@ return Ġa Ġ[ Boolean ] Ġthat Ġcorresponds Ġto Ġthe Ġstates Ġfrom Ġ[ true Cases ] Ġor Ġ[ false Cases ] Ġrespectively Ċĉ Ġ* Ġ@ throws ĠChat Command Syntax Exception Ġif Ġa Ġstate Ġwith Ġthe Ġgive Ġname Ġdoes Ġnot Ġexist Ċĉ Ġ*/ Ċ ĉ override Ġfun Ġparse ( reader : ĠString Reader ): ĠBoolean Ġ{ Ċĉ ĉ return Ġwhen Ġ( reader . read Un quoted ()) Ġ{ Ċĉĉ ĉ in Ġtrue Cases () Ġ-> Ġtrue Ċĉĉ ĉ in Ġfalse Cases () Ġ-> Ġfalse Ċĉĉ ĉ else Ġ-> Ġthrow Ġunknown StateException Type . create WithContext ( reader ) Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ /** Ċĉ Ġ* ĠReturns Ġthe Ġnames Ġof Ġstates Ġfrom Ġthe Ġresults Ġof Ġthe Ġ[ true Cases ] Ġand Ġ[ false Cases ] Ċĉ Ġ* Ġthat Ġstart Ġwith Ġthe Ġremaining Ġinput Ġof Ġthe Ġgiven Ġ[ builder ]. Ċĉ Ġ* Ċĉ Ġ* Ġ@ param ĠS Ġthe Ġtype Ġof Ġthe Ġsource Ċĉ Ġ* Ġ@ param Ġcontext Ġthe Ġcontext Ċĉ Ġ* Ġ@ param Ġbuilder Ġthe Ġbuilder Ċĉ Ġ* Ġ@ return Ġthe Ġstate Ġnames Ġthat Ġbegin Ġwith Ġthe Ġremaining Ġinput Ċĉ Ġ*/ Ċ ĉ override Ġfun Ġ< S > Ġlist Suggestions ( Ċĉ ĉ context : ĠCommand Context < S >, Ċĉ ĉ builder : ĠSuggest ions Builder Ċ ĉ ): ĠCompletableFuture < Suggestions > Ġ{ Ċĉ ĉ ( true Cases () Ġ+ Ġfalse Cases ()) Ċĉĉ ĉ . filter Keys Ġ{ Ġit . startsWith ( builder . remaining , Ġtrue ) Ġ} Ċĉĉ ĉ . forEach Ġ{ Ġ( case , Ġtooltip ) Ġ-> Ċĉĉĉ ĉ if Ġ( tooltip Ġ!= Ġnull ) Ċĉĉĉĉ ĉ builder . suggest ( case , Ġtooltip ) Ċĉĉĉ ĉ else Ċĉĉĉĉ ĉ builder . suggest ( case ) Ċĉĉ ĉ } Ċĉ ĉ return Ġbuilder . build Future () Ċ ĉ } ĊĊ ĉ override Ġfun Ġget Examples (): ĠCollection < String > Ġ= ĠlistOf (" enable ", Ġ" disable ") ĊĊĊ ĉ comp anion Ġobject ĠInstance Ġ: ĠState Type ( Ċĉ ĉ true Cases Ġ= Ġ{ Ġmap Of (" enable " Ġto Ġnull ) Ġ}, Ċĉ ĉ false Cases Ġ= Ġ{ Ġmap Of (" disable " Ġto Ġnull ) Ġ}, Ċĉ ĉ unknown StateException Type Ġ= Ċĉĉ ĉ Chat Command Exception Type ( Trans latable Component (" command . unknown . argument ")) Ċ ĉ ) Ċ }