'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _and = require('../format/filter/and.js');

var _and2 = _interopRequireDefault(_and);

var _bbox = require('../format/filter/bbox.js');

var _bbox2 = _interopRequireDefault(_bbox);

var _contains = require('../format/filter/contains.js');

var _contains2 = _interopRequireDefault(_contains);

var _during = require('../format/filter/during.js');

var _during2 = _interopRequireDefault(_during);

var _equalto = require('../format/filter/equalto.js');

var _equalto2 = _interopRequireDefault(_equalto);

var _greaterthan = require('../format/filter/greaterthan.js');

var _greaterthan2 = _interopRequireDefault(_greaterthan);

var _greaterthanorequalto = require('../format/filter/greaterthanorequalto.js');

var _greaterthanorequalto2 = _interopRequireDefault(_greaterthanorequalto);

var _intersects = require('../format/filter/intersects.js');

var _intersects2 = _interopRequireDefault(_intersects);

var _isbetween = require('../format/filter/isbetween.js');

var _isbetween2 = _interopRequireDefault(_isbetween);

var _islike = require('../format/filter/islike.js');

var _islike2 = _interopRequireDefault(_islike);

var _isnull = require('../format/filter/isnull.js');

var _isnull2 = _interopRequireDefault(_isnull);

var _lessthan = require('../format/filter/lessthan.js');

var _lessthan2 = _interopRequireDefault(_lessthan);

var _lessthanorequalto = require('../format/filter/lessthanorequalto.js');

var _lessthanorequalto2 = _interopRequireDefault(_lessthanorequalto);

var _not = require('../format/filter/not.js');

var _not2 = _interopRequireDefault(_not);

var _notequalto = require('../format/filter/notequalto.js');

var _notequalto2 = _interopRequireDefault(_notequalto);

var _or = require('../format/filter/or.js');

var _or2 = _interopRequireDefault(_or);

var _within = require('../format/filter/within.js');

var _within2 = _interopRequireDefault(_within);

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : { default: obj };
}

var _ol_format_filter_ = {};

/**
 * Create a logical `<And>` operator between two or more filter conditions.
 *
 * @param {...ol.format.filter.Filter} conditions Filter conditions.
 * @returns {!ol.format.filter.And} `<And>` operator.
 * @api
 */
_ol_format_filter_.and = function (conditions) {
  var params = [null].concat(Array.prototype.slice.call(arguments));
  return new (Function.prototype.bind.apply(_and2.default, params))();
};

/**
 * Create a logical `<Or>` operator between two or more filter conditions.
 *
 * @param {...ol.format.filter.Filter} conditions Filter conditions.
 * @returns {!ol.format.filter.Or} `<Or>` operator.
 * @api
 */
_ol_format_filter_.or = function (conditions) {
  var params = [null].concat(Array.prototype.slice.call(arguments));
  return new (Function.prototype.bind.apply(_or2.default, params))();
};

/**
 * Represents a logical `<Not>` operator for a filter condition.
 *
 * @param {!ol.format.filter.Filter} condition Filter condition.
 * @returns {!ol.format.filter.Not} `<Not>` operator.
 * @api
 */
_ol_format_filter_.not = function (condition) {
  return new _not2.default(condition);
};

/**
 * Create a `<BBOX>` operator to test whether a geometry-valued property
 * intersects a fixed bounding box
 *
 * @param {!string} geometryName Geometry name to use.
 * @param {!ol.Extent} extent Extent.
 * @param {string=} opt_srsName SRS name. No srsName attribute will be
 *    set on geometries when this is not provided.
 * @returns {!ol.format.filter.Bbox} `<BBOX>` operator.
 * @api
 */
_ol_format_filter_.bbox = function (geometryName, extent, opt_srsName) {
  return new _bbox2.default(geometryName, extent, opt_srsName);
};

/**
 * Create a `<Contains>` operator to test whether a geometry-valued property
 * contains a given geometry.
 *
 * @param {!string} geometryName Geometry name to use.
 * @param {!ol.geom.Geometry} geometry Geometry.
 * @param {string=} opt_srsName SRS name. No srsName attribute will be
 *    set on geometries when this is not provided.
 * @returns {!ol.format.filter.Contains} `<Contains>` operator.
 * @api
 */
_ol_format_filter_.contains = function (geometryName, geometry, opt_srsName) {
  return new _contains2.default(geometryName, geometry, opt_srsName);
};

/**
 * Create a `<Intersects>` operator to test whether a geometry-valued property
 * intersects a given geometry.
 *
 * @param {!string} geometryName Geometry name to use.
 * @param {!ol.geom.Geometry} geometry Geometry.
 * @param {string=} opt_srsName SRS name. No srsName attribute will be
 *    set on geometries when this is not provided.
 * @returns {!ol.format.filter.Intersects} `<Intersects>` operator.
 * @api
 */
_ol_format_filter_.intersects = function (geometryName, geometry, opt_srsName) {
  return new _intersects2.default(geometryName, geometry, opt_srsName);
};

/**
 * Create a `<Within>` operator to test whether a geometry-valued property
 * is within a given geometry.
 *
 * @param {!string} geometryName Geometry name to use.
 * @param {!ol.geom.Geometry} geometry Geometry.
 * @param {string=} opt_srsName SRS name. No srsName attribute will be
 *    set on geometries when this is not provided.
 * @returns {!ol.format.filter.Within} `<Within>` operator.
 * @api
 */
_ol_format_filter_.within = function (geometryName, geometry, opt_srsName) {
  return new _within2.default(geometryName, geometry, opt_srsName);
};

/**
 * Creates a `<PropertyIsEqualTo>` comparison operator.
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @param {!(string|number)} expression The value to compare.
 * @param {boolean=} opt_matchCase Case-sensitive?
 * @returns {!ol.format.filter.EqualTo} `<PropertyIsEqualTo>` operator.
 * @api
 */
_ol_format_filter_.equalTo = function (propertyName, expression, opt_matchCase) {
  return new _equalto2.default(propertyName, expression, opt_matchCase);
};

/**
 * Creates a `<PropertyIsNotEqualTo>` comparison operator.
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @param {!(string|number)} expression The value to compare.
 * @param {boolean=} opt_matchCase Case-sensitive?
 * @returns {!ol.format.filter.NotEqualTo} `<PropertyIsNotEqualTo>` operator.
 * @api
 */
_ol_format_filter_.notEqualTo = function (propertyName, expression, opt_matchCase) {
  return new _notequalto2.default(propertyName, expression, opt_matchCase);
};

/**
 * Creates a `<PropertyIsLessThan>` comparison operator.
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @param {!number} expression The value to compare.
 * @returns {!ol.format.filter.LessThan} `<PropertyIsLessThan>` operator.
 * @api
 */
_ol_format_filter_.lessThan = function (propertyName, expression) {
  return new _lessthan2.default(propertyName, expression);
};

/**
 * Creates a `<PropertyIsLessThanOrEqualTo>` comparison operator.
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @param {!number} expression The value to compare.
 * @returns {!ol.format.filter.LessThanOrEqualTo} `<PropertyIsLessThanOrEqualTo>` operator.
 * @api
 */
_ol_format_filter_.lessThanOrEqualTo = function (propertyName, expression) {
  return new _lessthanorequalto2.default(propertyName, expression);
};

/**
 * Creates a `<PropertyIsGreaterThan>` comparison operator.
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @param {!number} expression The value to compare.
 * @returns {!ol.format.filter.GreaterThan} `<PropertyIsGreaterThan>` operator.
 * @api
 */
_ol_format_filter_.greaterThan = function (propertyName, expression) {
  return new _greaterthan2.default(propertyName, expression);
};

/**
 * Creates a `<PropertyIsGreaterThanOrEqualTo>` comparison operator.
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @param {!number} expression The value to compare.
 * @returns {!ol.format.filter.GreaterThanOrEqualTo} `<PropertyIsGreaterThanOrEqualTo>` operator.
 * @api
 */
_ol_format_filter_.greaterThanOrEqualTo = function (propertyName, expression) {
  return new _greaterthanorequalto2.default(propertyName, expression);
};

/**
 * Creates a `<PropertyIsNull>` comparison operator to test whether a property value
 * is null.
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @returns {!ol.format.filter.IsNull} `<PropertyIsNull>` operator.
 * @api
 */
_ol_format_filter_.isNull = function (propertyName) {
  return new _isnull2.default(propertyName);
};

/**
 * Creates a `<PropertyIsBetween>` comparison operator to test whether an expression
 * value lies within a range given by a lower and upper bound (inclusive).
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @param {!number} lowerBoundary The lower bound of the range.
 * @param {!number} upperBoundary The upper bound of the range.
 * @returns {!ol.format.filter.IsBetween} `<PropertyIsBetween>` operator.
 * @api
 */
_ol_format_filter_.between = function (propertyName, lowerBoundary, upperBoundary) {
  return new _isbetween2.default(propertyName, lowerBoundary, upperBoundary);
};

/**
 * Represents a `<PropertyIsLike>` comparison operator that matches a string property
 * value against a text pattern.
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @param {!string} pattern Text pattern.
 * @param {string=} opt_wildCard Pattern character which matches any sequence of
 *    zero or more string characters. Default is '*'.
 * @param {string=} opt_singleChar pattern character which matches any single
 *    string character. Default is '.'.
 * @param {string=} opt_escapeChar Escape character which can be used to escape
 *    the pattern characters. Default is '!'.
 * @param {boolean=} opt_matchCase Case-sensitive?
 * @returns {!ol.format.filter.IsLike} `<PropertyIsLike>` operator.
 * @api
 */
_ol_format_filter_.like = function (propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {
  return new _islike2.default(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase);
};

/**
 * Create a `<During>` temporal operator.
 *
 * @param {!string} propertyName Name of the context property to compare.
 * @param {!string} begin The begin date in ISO-8601 format.
 * @param {!string} end The end date in ISO-8601 format.
 * @returns {!ol.format.filter.During} `<During>` operator.
 * @api
 */
_ol_format_filter_.during = function (propertyName, begin, end) {
  return new _during2.default(propertyName, begin, end);
};
exports.default = _ol_format_filter_;
module.exports = exports['default'];