[Persistence] Add JSDoc

Add JSDoc to classes added/modified to support multiple persistence
spaces, nasa/openmctweb#245.
This commit is contained in:
Victor Woeltjen
2015-11-10 14:16:07 -08:00
parent a14f30c03c
commit 04ce2f985a
6 changed files with 57 additions and 3 deletions

View File

@@ -28,11 +28,22 @@ define(
/**
* Parses and generates domain object identifiers.
* @param {string} defaultSpace the default persistence space
* @constructor
* @memberof {platform/core}
*/
function IdentifierProvider(defaultSpace) {
this.defaultSpace = defaultSpace;
}
/**
* Generate a new domain object identifier. A persistence space
* may optionally be included; if not specified, no space will
* be encoded into the identifier.
* @param {string} [space] the persistence space to encode
* in this identifier
* @returns {string} a new domain object identifier
*/
IdentifierProvider.prototype.generate = function (space) {
var id = uuid();
if (space !== undefined) {
@@ -41,6 +52,11 @@ define(
return id;
};
/**
* Parse a domain object identifier to examine its component
* parts (e.g. its persistence space.)
* @returns {platform/core.Identifier} the parsed identifier
*/
IdentifierProvider.prototype.parse = function (id) {
return new Identifier(id, this.defaultSpace);
};