-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic validations to identifier setters #157
Conversation
…prone API calls - Trim whitespace from identifiers - Reject with warning any blank string value for identifiers - Setting identifiers with the fluent setters to the same value as before will not enqueue an API request
@@ -58,3 +58,10 @@ sealed class ProfileKey(name: String) : Keyword(name) { | |||
else -> name | |||
} | |||
} | |||
|
|||
internal val PROFILE_IDENTIFIERS = arrayOf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to put this inside Profile.companionObject
but there must be some initialization order issue, because it just came out as an array of nulls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
) | ||
null | ||
}?.also { validatedIdentifier -> | ||
var property by when (propertyKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right?? kotlin is cool
Description
Adds a few very basic validations to the setter functions for identifiers. This will cut down on some avoidable API errors and duplicative API calls.
Check List
Changelog / Code Overview
Test Plan
Related Issues/Tickets
CHNL-7204