Class: Attribute

Attribute

Attribute defines name, type (string, double,...) an associated parameter of an attribute.

new Attribute()

Initializes the Attribute.

Methods

addParameter(parameter)

Adds a parameter.

Name Type Description
parameter Parameter

Parameter

equalsTypeOf(attribute){boolean}

Compares this instance with the given one.

Name Type Description
attribute Attribute

Attribute that should be compared.

Returns:
Type Description
boolean

equalsValueOf(attribute){Boolean}

Name Type Description
attribute Attribute
Returns:
Type Description
Boolean

getName(){string}

Returns the name.

Returns:
Type Description
string

Returns the parameters.

Returns:
Type Description
ParameterList

getTimestamp(){Number}

Returns the timestamp.

Returns:
Type Description
Number

getType(){string}

Returns the type.

Returns:
Type Description
string

getValue(){string}

Returns the value.

Returns:
Type Description
string

hasInputParameter(){boolean}

Returns:
Type Description
boolean

hasParameters(){boolean}

Returns true if the attribute is parameterized.

Returns:
Type Description
boolean

Sets the name.

Name Type Description
name string

Name

setParameters(parameters)

Adds a list of Parameter.

Name Type Description
parameters ParameterList

ParameterList

setTimestamp(time)

Sets the timestamp.

Name Type Description
time Date

timestamp

Sets the type.

Name Type Description
type string

Type

Sets the value.

Name Type Description
value string

value

Returns:
Type Description
Attribute

toString(){String}

Returns an identifier that uniquely describes the attribute type and its parameters. The identifier can be used to compare two attribute types.
Format: (AttributeName:AttributeType)#[FirstParameterName:FirstParameterValue]…

Returns:
Type Description
String
Example

(CI_USER_LOCATION_DISTANCE:FLOAT)#[CP_TARGET_LATITUDE:52][CP_TARGET_LONGITUDE:13][CP_UNIT:KILOMETERS]

Builder for name.

Name Type Description
name String

The attribute name to build with.

Returns:
Type Description
Attribute

withParameter(parameter){Attribute}

Builder for one parameter.

Name Type Description
parameter Parameter

The parameter to build with.

Returns:
Type Description
Attribute

withParameters(parameterList){Attribute}

Builder for parameterList.

Name Type Description
parameterList ParameterList | Array

ParameterList

Returns:
Type Description
Attribute

withTimestamp(timestamp){Attribute}

Builder for timestamp.

Name Type Description
timestamp Date

timestamp

Returns:
Type Description
Attribute

Builder for type.

Name Type Description
type String

The attribute type to build with.

Returns:
Type Description
Attribute

Builder for value.

Name Type Description
value String

value

Returns:
Type Description
Attribute