{"size": 862, "ext": "js", "max_stars_repo_path": "network/server/endpoints/Endpoint.js", "max_stars_repo_name": "barchart/common-node-js", "max_stars_repo_stars_event_min_datetime": "2020-04-02T20:05:13.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-02T20:05:13.000Z", "max_issues_repo_path": "network/server/endpoints/Endpoint.js", "max_issues_repo_name": "barchart/common-node-js", "max_issues_repo_issues_event_min_datetime": "2018-01-26T09:08:28.000Z", "max_issues_repo_issues_event_max_datetime": "2019-07-25T20:13:36.000Z", "max_forks_repo_path": "network/server/endpoints/Endpoint.js", "max_forks_repo_name": "barchart/barchart-common-node-js", "max_forks_repo_forks_event_min_datetime": "2021-02-01T04:47:15.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-01T04:47:15.000Z"}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 26.9375, "max_line_length": 103, "alphanum_fraction": 0.747099768}
const assert = require('@barchart/common-js/lang/assert'),
	CommandHandler = require('@barchart/common-js/commands/CommandHandler');

module.exports = (() => {
	'use strict';

	class Endpoint {
		constructor(executionCommand, validationCommand) {
			assert.argumentIsRequired(executionCommand, 'executionCommand', CommandHandler, 'CommandHandler');
			assert.argumentIsOptional(validationCommand, 'validationCommand', CommandHandler, 'CommandHandler');

			this._executionCommand = executionCommand;
			this._validationCommand = validationCommand || emptyValidationCommand;
		}

		getExecutionCommand() {
			return this._executionCommand;
		}

		getValidationCommand() {
			return this._validationCommand;
		}

		toString() {
			return '[Endpoint]';
		}
	}

	const emptyValidationCommand = CommandHandler.fromFunction((context) => true);

	return Endpoint;
})();