Skip to content

Instantly share code, notes, and snippets.

@ngallazzi
Created February 4, 2022 14:08
Show Gist options
  • Save ngallazzi/d23dd236dae72423b7a42baede50b7e5 to your computer and use it in GitHub Desktop.
Save ngallazzi/d23dd236dae72423b7a42baede50b7e5 to your computer and use it in GitHub Desktop.
Mastering refactoring - Introduce parameter object, starting code
private fun printInvoiceHeader(invoiceNumber: Int, invoiceDate: LocalDate, format: DateTimeFormatter) {
val invoiceHeader =
"INVOICE N° ${invoiceNumber}, ${invoiceDate.format(format)}\n\n"
binding.tvInvoicePreview.text = invoiceHeader
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment