-
Notifications
You must be signed in to change notification settings - Fork 14
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
platform bytes class #204
platform bytes class #204
Conversation
|
||
package protokt.v1 | ||
|
||
abstract class AbstractBytes internal constructor( |
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.
Seems to be the only way to share this code.
final override fun toString() = | ||
value.contentToString() | ||
|
||
internal companion object { |
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.
Used to hold common code in implementation companions rather than exposing a new public class. The same could be done with AbstractBytes but then the implementation would have to call into this object rather than inheriting the correct behavior. This pattern is already used in AbstractKtMessage and AbstractKtDeserializer, so it feels OK to be consistent with those.
No description provided.