forked from benasher44/uuid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds more deprecations to prepare for the 0.0.8, where I plan to use java.util.UUID on JVM.
- Loading branch information
1 parent
cdfe9c7
commit d0488fc
Showing
4 changed files
with
52 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@file:Suppress("RedundantVisibilityModifier") | ||
|
||
import com.benasher44.uuid.Uuid | ||
import com.benasher44.uuid.uuidFrom | ||
|
||
@Deprecated("Use `Uuid` instead.", ReplaceWith("Uuid")) | ||
public typealias UUID = Uuid | ||
|
||
/** | ||
* Parses a UUID from a String | ||
* | ||
* @param from The String, from which to deserialize the UUID | ||
* @return a UUID, if the string is a valid UUID string | ||
*/ | ||
@Deprecated( | ||
message = "Use uuidFrom() instead. This will be removed in the next release", | ||
replaceWith = ReplaceWith("uuidFrom(from)"), | ||
level = DeprecationLevel.ERROR | ||
) | ||
public fun Uuid.Companion.parse(from: String): Uuid? { | ||
return try { | ||
uuidFrom(from) | ||
} catch (_: Throwable) { | ||
null | ||
} | ||
} | ||
|
||
@Deprecated( | ||
message = "Use uuidFrom() instead. This will be removed in the next release.", | ||
replaceWith = ReplaceWith("Uuid.bytes") | ||
) | ||
public val Uuid.uuid: ByteArray | ||
get() = uuidBytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters