Skip to content

Implementing cl_system_uuid=>if_system_uuid_static~create_uuid_c36 #931

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/uuid/cl_system_uuid.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CLASS cl_system_uuid DEFINITION PUBLIC.
INTERFACES if_system_uuid_static.

ALIASES create_uuid_c32_static FOR if_system_uuid_static~create_uuid_c32.
ALIASES create_uuid_c36_static FOR if_system_uuid_static~create_uuid_c36.
ALIASES create_uuid_x16_static FOR if_system_uuid_static~create_uuid_x16.
PRIVATE SECTION.
CLASS-METHODS random RETURNING VALUE(rv_str) TYPE string.
Expand Down Expand Up @@ -37,6 +38,13 @@ CLASS cl_system_uuid IMPLEMENTATION.
TRANSLATE uuid TO UPPER CASE.
ENDMETHOD.

METHOD if_system_uuid_static~create_uuid_c36.
DATA lv_str TYPE string.
lv_str = random( ).
TRANSLATE lv_str TO UPPER CASE.
uuid = lv_str.
ENDMETHOD.

METHOD if_system_uuid_rfc4122_static~create_uuid_c36_by_version.
ASSERT version = 4.
uuid = random( ).
Expand Down
5 changes: 5 additions & 0 deletions src/uuid/cl_system_uuid.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CLASS ltcl_test DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
METHODS create_uuid_c36_by_version FOR TESTING RAISING cx_static_check.
METHODS create_uuid_x16 FOR TESTING RAISING cx_static_check.
METHODS create_uuid_c32 FOR TESTING RAISING cx_static_check.
METHODS create_uuid_c36 FOR TESTING RAISING cx_static_check.
METHODS create_uuid_c32_dyn FOR TESTING RAISING cx_static_check.
ENDCLASS.

Expand All @@ -21,6 +22,10 @@ CLASS ltcl_test IMPLEMENTATION.
cl_abap_unit_assert=>assert_not_initial( cl_system_uuid=>if_system_uuid_static~create_uuid_c32( ) ).
ENDMETHOD.

METHOD create_uuid_c36.
cl_abap_unit_assert=>assert_not_initial( cl_system_uuid=>if_system_uuid_static~create_uuid_c36( ) ).
ENDMETHOD.

METHOD create_uuid_c32_dyn.
" DATA uuid TYPE c LENGTH 32.
" CALL METHOD (`CL_SYSTEM_UUID`)=>create_uuid_c32_static
Expand Down
6 changes: 6 additions & 0 deletions src/uuid/if_system_uuid_static.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ INTERFACE if_system_uuid_static PUBLIC.
RAISING
cx_uuid_error.

CLASS-METHODS create_uuid_c36
RETURNING
VALUE(uuid) TYPE sysuuid_c36
RAISING
cx_uuid_error.

CLASS-METHODS create_uuid_c22
RETURNING
VALUE(uuid) TYPE sysuuid_c22
Expand Down