package Ġnl . dev ha an . kotlin po et dsl .` interface ` Ċ Ċ import Ġcom . squareup . kotlin po et . K Modifier Ċ import Ġcom . squareup . kotlin po et . TypeName Ċ import Ġcom . squareup . kotlin po et . Type Spec Ċ import Ġcom . squareup . kotlin po et . as TypeName Ċ import Ġnl . dev ha an . kotlin po et dsl . I Accept or Ċ import Ġnl . dev ha an . kotlin po et dsl . I Accessor Ċ import Ġnl . dev ha an . kotlin po et dsl . Modifier Editor DSL Ċ import Ġnl . dev ha an . kotlin po et dsl . Plain Accessor Ċ import Ġnl . dev ha an . kotlin po et dsl . Provide Builder Accept or . Implementation Data Ċ import Ġnl . dev ha an . kotlin po et dsl .` interface `. Interface Accept or . Incomplete Inter f Builder Ċ import Ġnl . dev ha an . kotlin po et dsl . classes . build Up on Ċ import Ġkotlin . reflect . K Class ĊĊ Ċ interface ĠInterface Accept or Ġ: ĠI Accept or Ġ{ ĊĠĠĠ Ġclass ĠIn complete Inter f Builder ( val Ġaccept or : ĠInterface Accept or , Ġval Ġinterf Builder : ĠInterface Builder ) ĊĠĠĠ Ġfun Ġaccept ( type : ĠType Spec ) ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠAdds ĠTypes pec Ġkeeping Ġmodifiers ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġfun ĠType Spec . attach Inter f () Ġ= Ġthis @ Interface Accept or . accept ( this ) ĊĊĠĠĠ Ġfun ĠType Spec . attach Inter f ( edit Modifiers : ĠModifier Editor DSL . ()-> Set < K Modifier >) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnew Modifiers Ġ= ĠModifier Editor DSL ( this . modifiers ). edit Modifiers () ĊĠĠĠĠĠĠĠ Ġthis . build Up on Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis @ build Up on . modifiers . clear () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis @ build Up on . modifiers . addAll ( new Modifiers ) ĊĠĠĠĠĠĠĠ Ġ}. attach Inter f () ĊĠĠĠ Ġ} Ċ Ċ } ĊĊ Ċ // functions Ġare Ġprivate , Ġsuch Ġthat Ġthey Ġdon 't Ġpopup Ġin Ġthe ĠDSL Ċ private Ġinline Ġfun ĠIn complete Inter f Builder . un Finished ( build Script : ĠInterface Builder . () Ġ-> ĠUnit ) ĊĠĠĠĠĠĠĠ Ġ= Ġapply Ġ{ Ġbuild Script ( inter f Builder ) Ġ} Ċ private Ġinline Ġfun ĠIn complete Inter f Builder . finished ( build Script : ĠInterface Builder . () Ġ-> ĠType Spec ): ĠType Spec Ġ{ ĊĠĠĠ Ġaccept or . unregister Builder ( inter f Builder ) ĊĠĠĠ Ġreturn Ġbuild Script ( inter f Builder ) Ċ } Ċ private Ġfun ĠInterface Accept or . in complete Builder () Ġ= ĠIn complete Inter f Builder ( this , Ġinterf Builder (). also ( this :: register Builder )) Ċ private Ġfun ĠInterface Accept or . inter f Builder () Ġ= ĠInterface Builder ( ĊĠĠĠĠĠĠĠ Ġaccessor Ġ= Ġthis Ġas ? ĠI Accessor < *> Ġ?: ĠPlain Accessor (), ĊĠĠĠĠĠĠĠ Ġadding Ġ= Ġ:: accept Ċ ) ĊĊ Ċ // -------------------------------- --------------- Ġonly Ġincomplete Ċ fun ĠIn complete Inter f Builder . implements ( var arg Ġtype Names : ĠType Name , Ġbuild Script : ĠInterface Builder . () Ġ-> ĠUnit ) Ġ= ĊĠĠĠĠĠĠĠ Ġfinished Ġ{ Ġimplements (* type Names ). finish Build ( build Script ) Ġ} Ċ fun ĠIn complete Inter f Builder . implements ( var arg Ġclazz es : ĠK Class <* >, Ġbuild Script : ĠInterface Builder . () Ġ-> ĠUnit ) Ġ= ĊĠĠĠĠĠĠĠ Ġfinished Ġ{ Ġimplements (* clazz es ). finish Build ( build Script ) Ġ} Ċ Ċ infix Ġfun ĠIn complete Inter f Builder . implements ( implementation Data : ĠImplementation Data < Interface Builder >) Ġ= ĊĠĠĠĠĠĠĠ Ġfinished Ġ{ Ġfinish Build ( implementation Data ) Ġ} Ċ Ċ // -------------------------------- --------------- Ġcomplete Ġand Ġincomplete Ċ fun ĠIn complete Inter f Builder . implements ( var arg Ġclazz es : ĠK Class <* >) Ġ= Ġun Finished Ġ{ Ġimplements (* clazz es ) Ġ} Ċ fun ĠInterface Builder . implements ( var arg Ġclazz es : ĠK Class <* >) Ġ= Ġapply Ġ{ ĊĠĠĠ Ġclazz es . forEach Ġ{ Ġadd Implement ( it . as TypeName ()) Ġ} Ċ } ĊĊ Ċ fun ĠIn complete Inter f Builder . implements ( var arg Ġtype Names : ĠType Name ) Ġ= Ġun Finished Ġ{ Ġimplements (* type Names ) Ġ} Ċ fun ĠInterface Builder . implements ( var arg Ġtype Names : ĠType Name ) Ġ= Ġapply Ġ{ ĊĠĠĠ Ġtype Names . forEach Ġ{ Ġadd Implement ( it ) Ġ} Ċ } ĊĊ Ċ infix Ġfun ĠIn complete Inter f Builder . implements ( typeName : ĠType Name ) Ġ= Ġun Finished Ġ{ Ġadd Implement ( typeName ) Ġ} Ċ infix Ġfun ĠInterface Builder . implements ( typeName : ĠType Name ) Ġ= Ġadd Implement ( typeName ) ĊĊ Ċ infix Ġfun ĠIn complete Inter f Builder . implements ( clazz : ĠK Class <* >) Ġ= Ġun Finished Ġ{ Ġimplements ( clazz ) Ġ} Ċ infix Ġfun ĠInterface Builder . implements ( clazz : ĠK Class <* >) Ġ= Ġadd Implement ( clazz . as TypeName ()) Ċ Ċ // -------------------------------- --------------- Ġother Ġfunctions Ċ Ċ fun ĠInterface Accept or . inter f ( name : ĠString , Ġinit : ĠInterface Builder . () Ġ-> ĠUnit ) Ġ= Ġinterf Builder (). build ( name , Ġinit ) Ċ fun ĠInterface Accept or . inter f ( name : ĠString ) Ġ= Ġincomplete Builder (). un Finished Ġ{ Ġstart Build ( name ) Ġ}