package Ġdev . st alla . builder Ċ Ċ import Ġdev . st alla . model . atom . Atom Ċ import Ġdev . st alla . model . atom . Atom Person Ċ import Ġdev . st alla . model . atom . Link Ċ import Ġdev . st alla . util . when NotNull Ċ Ċ /** Ċ Ġ* ĠBuilder Ġfor Ġconstructing Ġ[ Atom ] Ġinstances . Ċ Ġ* Ċ Ġ* Ġ@ since Ġ 1 . 0 . 0 Ċ Ġ*/ Ċ public Ġinterface ĠAtom Builder Ġ: ĠBuilder < Atom > Ġ{ ĊĊĠĠĠ Ġ/** ĠAdds Ġthe Ġ[ Atom Person Builder ] Ġto Ġthe Ġlist Ġof Ġauthor Ġbuild ers . Ġ*/ ĊĠĠĠ Ġpublic Ġfun Ġadd Author Builder ( author Builder : ĠAtom Person Builder ): ĠAtom Builder ĊĊĠĠĠ Ġ/** ĠAdds Ġall Ġof Ġthe Ġ[ Atom Person Builder ] Ġto Ġthe Ġlist Ġof Ġauthor Ġbuild ers . Ġ*/ ĊĠĠĠ Ġpublic Ġfun Ġadd All Author Builders ( author Builders : ĠList < Atom Person Builder >): ĠAtom Builder Ġ= ĊĠĠĠĠĠĠĠ Ġapply Ġ{ Ġauthor Builders . forEach (:: add Author Builder ) Ġ} ĊĊĠĠĠ Ġ/** ĠAdds Ġthe Ġ[ Atom Person Builder ] Ġto Ġthe Ġlist Ġof Ġcontributor Ġbuild ers . Ġ*/ ĊĠĠĠ Ġpublic Ġfun Ġadd Contributor Builder ( contributor Builder : ĠAtom Person Builder ): ĠAtom Builder ĊĊĠĠĠ Ġ/** ĠAdds Ġall Ġof Ġthe Ġ[ Atom Person Builder ] Ġto Ġthe Ġlist Ġof Ġcontributor Ġbuild ers . Ġ*/ ĊĠĠĠ Ġpublic Ġfun Ġadd All Contributor Builders ( contributor Builders : ĠList < Atom Person Builder >): ĠAtom Builder Ġ= ĊĠĠĠĠĠĠĠ Ġapply Ġ{ Ġcontributor Builders . forEach (:: add Contributor Builder ) Ġ} ĊĊĠĠĠ Ġ/** ĠAdds Ġthe Ġ[ Link Builder ] Ġto Ġthe Ġlist Ġof Ġlinks . Ġ*/ ĊĠĠĠ Ġpublic Ġfun Ġadd Link Builder ( link Builder : ĠLink Builder ): ĠAtom Builder ĊĊĠĠĠ Ġ/** ĠAdds Ġall Ġof Ġthe Ġ[ Link Builder ] Ġto Ġthe Ġlist Ġof Ġlinks . Ġ*/ ĊĠĠĠ Ġpublic Ġfun Ġadd All Link Builders ( link Builders : ĠList < Link Builder >): ĠAtom Builder Ġ= ĊĠĠĠĠĠĠĠ Ġapply Ġ{ Ġlink Builders . forEach (:: add Link Builder ) Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġapply From ( prototype : ĠAtom ?): ĠAtom Builder Ġ= ĊĠĠĠĠĠĠĠ Ġwhen NotNull ( prototype ) Ġ{ Ġatom Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd All Author Builders ( atom . authors . map ( Atom Person . builder () :: apply From )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd All Contributor Builders ( atom . contributors . map ( Atom Person . builder () :: apply From )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd All Link Builders ( atom . links . map ( Link . builder () :: apply From )) ĊĠĠĠĠĠĠĠ Ġ} Ċ } Ċ