Skip to content

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Jan 21, 2022

🧭 What and Why

Optional parameters are required in java, unless you provide a different method definition that overrides and call the first method.

This PR adds a method only for required parameters, and provide the default or null value for the optional parameters.
The ideal way to do this would be to have a different method for each set of parameters, like:

GetLogsResponse getLogs() { 
  return getLogs(0, 10, null, "all");
}
GetLogsResponse getLogs(int offset) { 
  return getLogs(offset, 10, null, "all"); 
}
GetLogsResponse getLogs(int offset, int length) { 
  return getLogs(offset, length, null, "all"); 
}
GetLogsResponse getLogs(int offset, int length, String indexName) { 
  return getLogs(offset, length, indexName, "all"); 
}

But I have no idea how to do it in mustache

🧪 Test

Tests are coming soon with the CTS.

@millotp millotp self-assigned this Jan 21, 2022
@millotp millotp requested a review from damcou January 24, 2022 08:57
Copy link
Contributor

@damcou damcou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird but ok :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants