package Ġcom . nb ot tar ini . as im ov . flag z Ċ Ċ import Ġcom . nb ot tar ini . as im ov . flag z . conditional Str ategies . Conditional Strategy Ċ import Ġcom . nb ot tar ini . as im ov . flag z . manager . Default Flag z Manager Ċ import Ġcom . nb ot tar ini . as im ov . flag z . manager . Flag z Manager Ċ import Ġcom . nb ot tar ini . as im ov . flag z . repositories . Feature Repository Ċ import Ġcom . nb ot tar ini . as im ov . flag z . repositories . composite . Composite Feature Repository Ċ import Ġcom . nb ot tar ini . as im ov . flag z . repositories . in Memory . InMemory Feature Repository Ċ import Ġcom . nb ot tar ini . as im ov . flag z . user . provider . Thread Local User Provider Ċ import Ġcom . nb ot tar ini . as im ov . flag z . user . provider . User Provider Ċ Ċ class ĠFlag z Initialization Builder Ġ{ ĊĠĠĠ Ġprivate Ġvar Ġfeature Enums Ġ= Ġmutable ListOf < Class < out ĠFeature >>() ĊĠĠĠ Ġprivate Ġvar Ġrepository : ĠFeature Repository Ġ= ĠIn Memory Feature Repository () ĊĠĠĠ Ġprivate Ġvar Ġuser Provider : ĠUser Provider Ġ= ĠThread Local User Provider () ĊĠĠĠ Ġprivate Ġvar Ġconditional Str ategies Ġ= Ġmutable ListOf < Conditional Strategy >() ĊĊĠĠĠ Ġfun Ġfeature Enum ( value : ĠClass < out ĠFeature >) Ġ= Ġapply Ġ{ Ġfeature Enums . add ( value ) Ġ} ĊĊĠĠĠ Ġinline Ġfun Ġ< re ified ĠT : ĠFeature > Ġfeature Enum () Ġ= Ġfeature Enum ( T :: class . java ) ĊĊĠĠĠ Ġfun Ġrepository ( value : ĠFeature Repository ) Ġ= Ġapply Ġ{ Ġrepository Ġ= Ġvalue Ġ} ĊĊĠĠĠ Ġfun Ġrepositories ( var arg Ġvalues : ĠFeature Repository ) Ġ= Ġapply Ġ{ Ġrepository Ġ= ĠComposite Feature Repository ( values . toList ()) Ġ} ĊĊĠĠĠ Ġfun Ġuser Provider ( value : ĠUser Provider ) Ġ= Ġapply Ġ{ Ġuser Provider Ġ= Ġvalue Ġ} ĊĊĠĠĠ Ġfun Ġconditional Strategy ( value : ĠConditional Strategy ) Ġ= Ġapply Ġ{ Ġconditional Str ategies . add ( value ) Ġ} ĊĊĠĠĠ Ġfun Ġbuild (): ĠFlag z Manager Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmanager Ġ= ĠDefault Flag z Manager ( feature Enums , Ġrepository , Ġuser Provider ) ĊĠĠĠĠĠĠĠ Ġconditional Str ategies . forEach Ġ{ Ġmanager . add Conditional Strategy ( it ) Ġ} ĊĠĠĠĠĠĠĠ ĠFlag z Context . init ( manager ) ĊĠĠĠĠĠĠĠ Ġreturn Ġmanager ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun Ġinit Flag z ( add Details : ĠFlag z Initialization Builder . () Ġ-> ĠUnit ) Ġ= ĠFlag z Initialization Builder (). also ( add Details ). build () Ċ