We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a72469 commit d960602Copy full SHA for d960602
1 file changed
pyvalueobjects/strings/uuid4.py
@@ -5,11 +5,23 @@
5
6
7
class Uuid4(NonEmptyString):
8
+ """
9
+ A value object representing a UUID version 4 string. Inherits from NonEmptyString and validates that the input is a valid UUID v4 string.
10
11
12
def __init__(self, value: str):
13
14
+ Initialize the Uuid4 object with the given UUID v4 string value.
15
+ :param value: A UUID v4 string value.
16
17
super().__init__(value)
18
19
def _validate(self, value):
20
21
+ Validate that the given value is a valid UUID v4 string.
22
+ :param value: The value to validate.
23
+ :raises: ValueObjectError if the value is not a valid UUID v4 string.
24
25
super()._validate(value)
26
try:
27
uuid.UUID(str(value), version=4)
0 commit comments