diff --git a/packages/core/src/customId/CustomIdCodec.ts b/packages/core/src/customId/CustomIdCodec.ts index db0f4eef..94eb7cd1 100644 --- a/packages/core/src/customId/CustomIdCodec.ts +++ b/packages/core/src/customId/CustomIdCodec.ts @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Amgelo563 + * Copyright (c) 2024 Amgelo563 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -39,4 +39,13 @@ export interface CustomIdCodec> { /** Creates a {@link StringIterator} from a customId, leaving only the data that is not related to the referred object. */ createIteratorFromCustomId(customId: string): StringIterator | null; + + /** Returns the separator used to separate the data in the customId. */ + getSeparator(): string; + + /** Returns the separator used to separate protected data in the customId. */ + getDataSeparator(): string; + + /** Returns the namespace used to identify the customId. */ + getNamespace(): string; } diff --git a/packages/framework/src/customId/BasicCustomIdCodec.ts b/packages/framework/src/customId/BasicCustomIdCodec.ts index 69b5bce0..732a10fa 100644 --- a/packages/framework/src/customId/BasicCustomIdCodec.ts +++ b/packages/framework/src/customId/BasicCustomIdCodec.ts @@ -98,4 +98,16 @@ export class BasicCustomIdCodec> return builder ? builder.getObjectId() : null; } + + public getNamespace(): string { + return this.namespace; + } + + public getSeparator(): string { + return this.separator; + } + + public getDataSeparator(): string { + return this.dataSeparator; + } }