Class: OpenSearchParameter

opensearch/parameter.OpenSearchParameter(type, name, mandatory, optionsopt, minExclusiveopt, maxExclusiveopt, minInclusiveopt, maxInclusiveopt)

Class to describe a single OpenSearch URL parameter.

Constructor

new OpenSearchParameter(type, name, mandatory, optionsopt, minExclusiveopt, maxExclusiveopt, minInclusiveopt, maxInclusiveopt)

Class to describe a single OpenSearch URL parameter.
Parameters:
Name Type Attributes Default Description
type string The type of the parameter
name string The name of the parameter
mandatory boolean Whether the parameter is mandatory
options Array.<object> <optional>
null The possible values for this parameter
Properties
Name Type Description
label string The label of the option
value string The value of the option
minExclusive Number <optional>
The minimum value allowed for this parameter (exclusive)
maxExclusive Number <optional>
The maximum value allowed for this parameter (exclusive)
minInclusive Number <optional>
The minimum value allowed for this parameter (inclusive)
maxInclusive Number <optional>
The maximum value allowed for this parameter (inclusive)
Source:

Members

(readonly) mandatory

Whether the parameter is mandatory
Source:

(readonly) maxExclusive

The maximum value allowed for this parameter (exclusive)
Source:

(readonly) maxInclusive

The maximum value allowed for this parameter (inclusive)
Source:

(readonly) minExclusive

The minimum value allowed for this parameter (exclusive)
Source:

(readonly) minInclusive

The minimum value allowed for this parameter (inclusive)
Source:

(readonly) name

The name of the parameter
Source:

(readonly) options

The possible values for this parameter
Source:

(readonly) type

The type of the parameter
Source:

Methods

(static) deserialize(values) → {OpenSearchParameter}

Deserialize a parameter from a simple object.
Parameters:
Name Type Description
values object The serialized parameter
Source:
Returns:
The deserialized parameter
Type
OpenSearchParameter

(static) fromKeyValuePair(key, value) → {OpenSearchParameter|null}

Constructs a new OpenSearchParameter from a key value pair (e.g: from the query part of a KVP-URL). Returns null, when the value could not be parsed.
Parameters:
Name Type Description
key DOMNode the key of the key-value-pair.
value DOMNode the value of the key-value-pair.
Source:
Returns:
the constructed parameters object.
Type
OpenSearchParameter | null

(static) fromNode(node) → {OpenSearchParameter}

Constructs a new OpenSearchParameter from a DOM-Node.
Parameters:
Name Type Description
node DOMNode the node to create the parameter from.
Source:
Returns:
the constructed parameters object.
Type
OpenSearchParameter

combined(other) → {OpenSearchParameter}

Combines this parameter with the values of another parameter.
Parameters:
Name Type Description
other OpenSearchParameter the other parameter
Source:
Returns:
the combined parameter
Type
OpenSearchParameter

serialize() → {object}

Serialize the parameter to a simple object.
Source:
Returns:
The serialized parameter
Type
object

serializeValue(value) → {string}

Serialize the given value according to the internal type to be sent in a request.
Parameters:
Name Type Description
value Number | string | Date | array | object The value to serialize. The allowed types depend on the internal type.
Source:
Returns:
the serialized value.
Type
string