ActiveCampaign / postmark-java

Official Java client library for the Postmark HTTP API
https://postmarkapp.com
MIT License
35 stars 21 forks source link

Use List interface instead of ArrayList for return types and method parameters #41

Closed Nandi closed 2 years ago

Nandi commented 2 years ago

By using the List interface consumers of the API have more flexibility in how they interact with it.

Example when using this library with Kotlin: With ArrayList

val postmarkClient = Postmark.getApiClient(postmarkToken)
val messages = listOf(constructTemplateMessage(templateId, receiver, model)
postmarkClient.deliverMessageWithTemplate(messages as ArrayList<TemplatedMessage>)

With List

val postmarkClient = Postmark.getApiClient(postmarkToken)
val messages = listOf(constructTemplateMessage(templateId, receiver, model)
postmarkClient.deliverMessageWithTemplate(messages)