Skip to content

Commit

Permalink
Void -> Unit
Browse files Browse the repository at this point in the history
  • Loading branch information
ursjoss committed Jun 8, 2024
1 parent b2344bf commit 2ccbcf0
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract class AbstractMenuBuilder protected constructor(
iconType: IconType,
position: Navbar.ComponentPosition,
) {
NavbarButton<Void, P>(
NavbarButton<Unit, P>(
referringPageClass,
StringResourceModel(labelResource, menuPage, null)
).setIconType(iconType)
Expand Down Expand Up @@ -86,7 +86,7 @@ abstract class AbstractMenuBuilder protected constructor(
links: MutableList<AbstractLink>,
pageParameters: PageParameters = PageParameters(),
) {
MenuBookmarkablePageLink<Void, P>(
MenuBookmarkablePageLink<Unit, P>(
pageClass,
pageParameters,
StringResourceModel(label, component, null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private val log = logger()
@Slf4j
abstract class AbstractLoginPage<R : AbstractPage<*>>(
parameters: PageParameters?,
) : AbstractPage<Void>(parameters) {
) : AbstractPage<Unit>(parameters) {

@SpringBean
private lateinit var scipamatoProperties: ApplicationProperties
Expand All @@ -44,7 +44,7 @@ abstract class AbstractLoginPage<R : AbstractPage<*>>(
queue(newLoginForm("form"))
}

private fun newLoginForm(id: String): StatelessForm<Void> = object : StatelessForm<Void>(id) {
private fun newLoginForm(id: String): StatelessForm<Unit> = object : StatelessForm<Unit>(id) {
private val serialVersionUID: Long = 1L
override fun onSubmit() {
if (signIn(username, password)) {
Expand All @@ -55,7 +55,7 @@ abstract class AbstractLoginPage<R : AbstractPage<*>>(
error(getString("msg.login.failure"))
}
}
}.apply<StatelessForm<Void>> {
}.apply<StatelessForm<Unit>> {
defaultModel = CompoundPropertyModel(this@AbstractLoginPage)
}.also {
queue(newHeader("header"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.wicketstuff.annotation.mount.MountPath
@MountPath("logout")
abstract class AbstractLogoutPage<R : AbstractPage<*>>(
parameters: PageParameters?,
) : AbstractPage<Void>(parameters) {
) : AbstractPage<Unit>(parameters) {

@SpringBean
private lateinit var scipamatoProperties: ApplicationProperties
Expand All @@ -26,7 +26,7 @@ abstract class AbstractLogoutPage<R : AbstractPage<*>>(
}

@Suppress("SameParameterValue")
private fun newForm(id: String): StatelessForm<Void> = object : StatelessForm<Void>(id) {
private fun newForm(id: String): StatelessForm<Unit> = object : StatelessForm<Unit>(id) {
private val serialVersionUID: Long = 1L
override fun onSubmit() {
signOutAndInvalidate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.apache.wicket.model.Model
import org.apache.wicket.request.mapper.parameter.PageParameters

@WicketHomePage
class TestHomePage : AbstractPage<Void>(PageParameters()) {
class TestHomePage : AbstractPage<Unit>(PageParameters()) {

override val properties: ApplicationProperties
get() = TestApplicationProperties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import org.wicketstuff.annotation.mount.MountPath
@MountPath("/newsletters")
@AuthorizeInstantiation(Roles.USER, Roles.ADMIN)
@Suppress("SameParameterValue", "TooManyFunctions")
class NewsletterListPage(parameters: PageParameters?) : BasePage<Void>(parameters) {
class NewsletterListPage(parameters: PageParameters?) : BasePage<Unit>(parameters) {

@SpringBean
private lateinit var service: NewsletterService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class NewsletterTopicSortPage(
topics = service.getSortedNewsletterTopicsForNewsletter(newsletterTopicId)

queue(newHeader("header"))
queue(Form<Void>("form"))
queue(Form<Unit>("form"))
queue(newSortable("sortable", topics))
queue(newSubmitButton("submit"))
queue(newCancelButton("cancel"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ abstract class PaperPanel<T>(
mode
) where T : CodeBoxAware, T : NewsletterAware, T : AttachmentAware {

private var summaryLink: ResourceLink<Void>? = null
private var summaryShortLink: ResourceLink<Void>? = null
private var summaryLink: ResourceLink<Unit>? = null
private var summaryShortLink: ResourceLink<Unit>? = null

var authors: TextArea<String>? = null
var firstAuthor: TextField<String>? = null
Expand All @@ -96,7 +96,7 @@ abstract class PaperPanel<T>(
var doi: TextField<Any>? = null
var originalAbstract: TextArea<String>? = null

private var pubmedRetrieval: BootstrapAjaxLink<Void>? = null
private var pubmedRetrieval: BootstrapAjaxLink<Unit>? = null
private var attachments: DataTable<PaperAttachment, String>? = null
private var submit: BootstrapButton? = null
private val newsletterTopicChoice = NewsletterTopicModel(localization)
Expand Down Expand Up @@ -181,8 +181,8 @@ abstract class PaperPanel<T>(
summaryShortLink = makeSummaryShortLink("summaryShort")
form.addOrReplace(summaryShortLink)
considerAddingMoreValidation()
val addRemoveNewsletter: BootstrapAjaxLink<Void> = object :
BootstrapAjaxLink<Void>("modAssociation", Buttons.Type.Primary) {
val addRemoveNewsletter: BootstrapAjaxLink<Unit> = object :
BootstrapAjaxLink<Unit>("modAssociation", Buttons.Type.Primary) {
override fun onInitialize() {
super.onInitialize()
add(ButtonBehavior()
Expand Down Expand Up @@ -455,25 +455,25 @@ abstract class PaperPanel<T>(
}
}

private fun makeSummaryLink(id: String): ResourceLink<Void> {
private fun makeSummaryLink(id: String): ResourceLink<Unit> {
return makePdfResourceLink(id, summaryDataSource)
}

/**
* @return [PaperSummaryDataSource]
*/
protected abstract val summaryDataSource: PaperSummaryDataSource?
private fun makeSummaryShortLink(id: String): ResourceLink<Void> {
private fun makeSummaryShortLink(id: String): ResourceLink<Unit> {
return makePdfResourceLink(id, summaryShortDataSource)
}

/**
* @return [PaperSummaryShortDataSource]
*/
protected abstract val summaryShortDataSource: PaperSummaryShortDataSource?
private fun makePdfResourceLink(id: String, dataSource: JasperPaperDataSource<*>?): ResourceLink<Void> {
private fun makePdfResourceLink(id: String, dataSource: JasperPaperDataSource<*>?): ResourceLink<Unit> {
val button = "button."
val link: ResourceLink<Void> = object : ResourceLink<Void>(id, dataSource) {
val link: ResourceLink<Unit> = object : ResourceLink<Unit>(id, dataSource) {
private val serialVersionUID: Long = 1L
override fun onInitialize() {
super.onInitialize()
Expand Down Expand Up @@ -976,7 +976,7 @@ abstract class PaperPanel<T>(
}

private fun queuePubmedRetrievalLink(linkId: String) {
pubmedRetrieval = object : BootstrapAjaxLink<Void>(linkId, Buttons.Type.Primary) {
pubmedRetrieval = object : BootstrapAjaxLink<Unit>(linkId, Buttons.Type.Primary) {
private val serialVersionUID: Long = 1L
override fun onInitialize() {
super.onInitialize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.wicketstuff.annotation.mount.MountPath
@MountPath("/")
@AuthorizeInstantiation(Roles.USER, Roles.ADMIN, Roles.VIEWER)
@Suppress("SameParameterValue")
class PaperListPage(parameters: PageParameters?) : BasePage<Void?>(parameters) {
class PaperListPage(parameters: PageParameters?) : BasePage<Unit>(parameters) {

private val filter = PaperFilter()
private val dataProvider = PaperSlimByPaperFilterProvider(filter, RESULT_PAGE_SIZE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ abstract class ResultPanel protected constructor(
id: String,
private val dataProvider: AbstractPaperSlimProvider<out PaperSlimFilter>,
override val mode: Mode,
) : BasePanel<Void>(id) {
) : BasePanel<Unit>(id) {

@SpringBean
private lateinit var paperService: PaperService
Expand Down Expand Up @@ -404,7 +404,7 @@ abstract class ResultPanel protected constructor(
}


private fun newPdfSummaryTable(id: String, resourceKeyPart: String): ResourceLink<Void> {
private fun newPdfSummaryTable(id: String, resourceKeyPart: String): ResourceLink<Unit> {
val pdfCaption = StringResourceModel("paper_summary_table.titlePart", this, null).string
val brand = properties.brand
val rhf = ReportHeaderFields(
Expand All @@ -426,7 +426,7 @@ abstract class ResultPanel protected constructor(
}


private fun newPdfReferenceAbstract(id: String, resourceKeyPart: String): ResourceLink<Void> {
private fun newPdfReferenceAbstract(id: String, resourceKeyPart: String): ResourceLink<Unit> {
val brand = properties.brand
val pdfCaption = StringResourceModel("paper_reference_abstract.caption", this, null)
.setParameters(brand).string
Expand All @@ -447,7 +447,7 @@ abstract class ResultPanel protected constructor(
}

private fun newJasperResourceLink(id: String, resourceKeyPart: String, resource: JasperPaperDataSource<*>) =
ResourceLink<Void>(id, resource).apply {
ResourceLink<Unit>(id, resource).apply {
outputMarkupId = true
body = StringResourceModel("$LINK_RESOURCE_PREFIX$resourceKeyPart$LABEL_RESOURCE_TAG")
add(AttributeModifier(
Expand Down Expand Up @@ -486,7 +486,7 @@ abstract class ResultPanel protected constructor(

private fun addOrReplaceExportLink(id: String, initiate: (AjaxRequestTarget) -> Unit) {
val titleResourceKey = LINK_RESOURCE_PREFIX + id + TITLE_RESOURCE_TAG
val reviewLink: AjaxLink<Void> = object : AjaxLink<Void>(id) {
val reviewLink: AjaxLink<Unit> = object : AjaxLink<Unit>(id) {
private val serialVersionUID: Long = 1L
override fun onClick(target: AjaxRequestTarget) {
initiate(target)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ import org.apache.wicket.spring.injection.annot.SpringBean
import java.time.Duration

@AuthorizeInstantiation(Roles.USER, Roles.ADMIN)
class RefDataSyncPage(parameters: PageParameters) : BasePage<Void>(parameters) {
class RefDataSyncPage(parameters: PageParameters) : BasePage<Unit>(parameters) {

@SpringBean
private lateinit var jobLauncher: SyncJobLauncher

override fun onInitialize() {
super.onInitialize()
queue(BootstrapForm<Void>("synchForm"))
queue(BootstrapForm<Unit>("synchForm"))
queue(newButton("synchronize"))
queue(SyncResultListPanel("syncResults"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import org.wicketstuff.annotation.mount.MountPath
*/
@MountPath("new-studies")
@Suppress("SameParameterValue", "TooManyFunctions")
open class NewStudyListPage(parameters: PageParameters) : BasePage<Void>(parameters) {
open class NewStudyListPage(parameters: PageParameters) : BasePage<Unit>(parameters) {

@SpringBean
private lateinit var newStudyTopicService: NewStudyTopicService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import org.wicketstuff.annotation.mount.MountPath
@WicketHomePage
@MountPath("/")
@Suppress("SameParameterValue", "UnnecessaryAbstractClass", "TooManyFunctions")
class PublicPage(parameters: PageParameters) : BasePage<Void>(parameters) {
class PublicPage(parameters: PageParameters) : BasePage<Unit>(parameters) {

private val filter: PublicPaperFilter = PublicPaperFilter()
private val dataProvider = PublicPaperProvider(filter, RESULT_PAGE_SIZE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PublicPaperDetailPage : BasePage<PublicPaper> {
override fun onInitialize() {
super.onInitialize()

queue(Form<Void>("form"))
queue(Form<Unit>("form"))

queue(newNavigationButton("previous", FontAwesome6IconType.backward_step_s, paperIdManager::hasPrevious) {
paperIdManager.previous()
Expand Down

0 comments on commit 2ccbcf0

Please sign in to comment.