diffusion
Version:
Diffusion JavaScript client
78 lines (69 loc) • 2.19 kB
JavaScript
var _interface = require('util/interface')._interface;
/**
* Diffusion datatype implementations.
* <P>
* Datatypes are accessed via the <code>diffusion</code> singleton.
*
* @example
* // Get the JSON datatype
* var json = diffusion.datatypes.json();
*
* @example
* // Get a datatype via name
* var json = diffusion.datatypes.get('json');
*
* @namespace diffusion.datatypes
* @since 5.7
*/
module.exports = _interface('DataTypes', [
/**
* @return {diffusion.datatypes.BinaryDataType} The Binary data type
* @function diffusion.datatypes#binary
*/
'binary',
/**
* @return {diffusion.datatypes.JSONDataType} The JSON data type
* @function diffusion.datatypes#json
*/
'json',
/**
* @return {diffusion.datatypes.Int64DataType} The Int64 data type
* @function diffusion.datatypes#int64
*/
'int64',
/**
* @return {diffusion.datatypes.StringDataType} The String data type
* @function diffusion.datatypes#string
*/
'string',
/**
* @return {diffusion.datatypes.DoubleDataType} The Double data type
* @function diffusion.datatypes#double
*/
'double',
/**
* @return {diffusion.datatypes.RecordV2DataType} The RecordV2 data type
* @function diffusion.datatypes#recordv2
*/
'recordv2',
/**
* Obtain a {@link diffusion.datatypes.DataType} implementation by type name.
*
* @param {String} name - The type name, as returned by {@link diffusion.datatypes.DataType#name}.
* @return {diffusion.datatypes.DataType} The data type
* @throws Error if there is no data type for provided name
* @function diffusion.datatypes#get
*/
'get',
/**
* Obtain a {@link diffusion.datatypes.DataType} implementation by value class.
* <P>
* For {@link diffusion.datatypes.DoubleDataType}, the associated value class is <code>Number</code>.
*
* @param {Function} valueClass - the class
* @return {diffusion.datatypes.DataType} the data type
* @throws {Error} if there is no data type for provided class
* @function diffusion.datatypes#getByClass
*/
'getByClass'
]);