feat(key): Add KeyFormat#1227
Conversation
|
As for #1249, im unsure on what best to name that method, as we can't have another A: B: I like A more, just cause it makes more sense to me and sounds better (at least in my head). But, we would be breaking consistency with I understand that the methods in |
|
Another thing I thought about recently, is that it might be better to move the actual logic of creating/checking parsability of keys into the key format class. All the overloads I added in Key could be removed then and the existing ones just forward into |
|
Went ahead and implemented option A now, can always just rename the methods again if required. |
|
For consistency, we can use the name But ofc, I'm not a maintainer, just my thoughts on the topic. |
25493c0 to
bb89288
Compare
042979a to
e45a98f
Compare
e45a98f to
555de7c
Compare
This pull request adds a
KeyFormatclass to allow for easier creation of custom Keys using the API.KeyFormathas following functionality:namespaceto be used when no other namespace is specified in the key parsingseparatorto be used when parsing keysKeyFormat#parse(String)which parses a input string using the configured separator and fallback namespaceKeyFormat#key(String)which creates a key using the configured namespace and the input string as valueKeyFormat#parseable(String)to check if a input string can be parsed using the configuration of the key formatKeyFormat#asString(Key)to turn a key into a String using the configurationKeyFormat#asMinimalString(Key)to turn a Key into its minimal String using the configurationCloses #1222