Skip to content
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

Changed msb/lsb constructor #52

Merged
merged 1 commit into from
Dec 29, 2019
Merged

Changed msb/lsb constructor #52

merged 1 commit into from
Dec 29, 2019

Conversation

Fleshgrinder
Copy link
Collaborator

Fixes or Changes Proposed

  • Changed Java compatible constructor to a freestanding function. This is in relation to Parsing functions should be freestanding #29 and the problem that defining constructors for our class is something that hinders us in general from being compatible with different kinds of native implementations. The goal is that we can define the Uuid class as a typealias in Java but we cannot, for instance, require a Uuid(data: ByteArray) constructor since it is already defined and private. There might be the possibility to overwrite this somehow with a freestanding function of the same name but I believe that it is simpler to just go for freestanding functions for everything and stick with the proper naming for them. Should make for a cleaner API overall.
  • Changed the latest CHANGELOG entries a little.

Please note that this change is not breaking because we never released the Uuid(msb: Long, lsb: Long) constructor.

PR Checklist

  • I have added a CHANGELOG.md entry for any noteable changes or fixes.
  • I have added test coverage for any new behavior or bug fixes.

@benasher44
Copy link
Owner

Looks good! I'll merge once conflicts are resolved. Sorry for the delay!

Changed Java compatible constructor to a freestanding function. This is in relation to #29 and the problem that defining constructors for our class is something that hinders us in general from being compatible with different kinds of native implementations. The goal is that we can define the `Uuid` class as a `typealias` in Java but we cannot, for instance, require a `Uuid(data: ByteArray)` constructor since it is already defined and private. There might be the possibility to overwrite this somehow with a freestanding function of the same name but I believe that it is simpler to just go for freestanding functions for everything and stick with the proper naming for them. Should make for a cleaner API overall.

I also improved the CHANGELOG a little further and please note that this change is not breaking because we never released the `Uuid(msb: Long, lsb: Long)` constructor.
@benasher44
Copy link
Owner

This change is now breaking, but i'll do a follow-up PR to deprecate the previous contructor

@benasher44 benasher44 merged commit 2fb382f into benasher44:master Dec 29, 2019
benasher44 added a commit that referenced this pull request Dec 29, 2019
This adds the required deprecation to make #52 not breaking
@Fleshgrinder Fleshgrinder deleted the freestanding-msb-lsb branch December 29, 2019 09:50
@benasher44
Copy link
Owner

FYI: ended up further changing this in #66

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