目录

SamplePoint.Builder

Class Info

public static class Builder

Builder for SamplePoint.

Public Constructor Summary

Constructor Name

Builder(DataCollector dataCollector)

Creates a Builder object based on the data source.

Builder(DataType dataType)

Creates a Builder object based on the data type.

Public Method Summary

Qualifier and Type

Method Name and Description

SamplePoint

build()

Generates and creates a sampling point.

Builder

setActivityField(Field field, String activity)

Sets the activity type attribute value.

Builder

setFieldValue(Field field, double val)

Sets the double-precision floating-point attribute value of a sampling point.

Builder

setFieldValue(String fieldName, double val)

Sets the double-precision floating-point attribute value of a sampling point.

Builder

setFieldValue(Field field, int val)

Sets the integer attribute value of a sampling point.

Builder

setFieldValue(String fieldName, int val)

Sets the integer attribute value of a sampling point.

Builder

setFieldValue(Field field, long val)

Sets the long integer attribute value of a sampling point.

Builder

setFieldValue(String fieldName, long val)

Sets the long integer attribute value of a sampling point.

Builder

setFieldValue(Field field, Map<String, Value> mapVal)

Sets the mapped attribute value of a sampling point.

Builder

setFieldValue(String fieldName, Map<String, Value> mapVal)

Sets the mapped attribute value of a sampling point.

Builder

setFieldValue(Field field, String val)

Sets the string attribute value of a sampling point.

Builder

setFieldValue(String fieldName, String val)

Sets the string attribute value of a sampling point.

Builder

setId(long id)

Sets the ID of the sampling point.

Builder

setMetadata(String metadata)

Sets the metadata.

Builder

setRawDataCollector(DataCollector collector)

Sets the raw data collector.

Builder

setSamplingTime(long sampleTime, TimeUnit timeUnit)

Sets the sampling timestamp of instantaneous data.

Builder

setTimeInterval(long start, long end, TimeUnit timeUnit)

Sets the sampling timestamp of data within an interval.

Public Constructors

[h2]Builder(DataCollector dataCollector)

Constructor

public Builder(DataCollector dataCollector)

Creates a Builder object based on the data source.

Parameters

Name

Description

dataCollector

Data collector.

[h2]Builder(DataType dataType)

Constructor

public Builder(DataType dataType)

Creates a Builder object based on the data type.

Parameters

Name

Description

dataType

Data type.

Public Methods

[h2]build()

Method

public SamplePoint build()

Generates and creates a sampling point.

Returns

Type

Description

SamplePoint

Sampling point object.

[h2]setActivityField(Field field, String activity)

Method

public Builder setActivityField(Field field, String activity)

Sets the activity type attribute value.

Parameters

Name

Description

field

Data attribute.

activity

Activity.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(Field field, double val)

Method

public Builder setFieldValue(Field field, double val)

Sets the double-precision floating-point attribute value of a sampling point.

Parameters

Name

Description

field

Data attribute.

val

Double-precision floating-point number.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(String fieldName, double val)

Method

public Builder setFieldValue(String fieldName, double val)

Sets the double-precision floating-point attribute value of a sampling point.

Parameters

Name

Description

fieldName

Data attribute name.

val

Double-precision floating-point number.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(Field field, long val)

Method

public Builder setFieldValue(Field field, long val)

Sets the long integer attribute value of a sampling point.

Parameters

Name

Description

field

Data attribute.

val

Long integer.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(String fieldName, long val)

Method

public Builder setFieldValue(String fieldName, long val)

Sets the long integer attribute value of a sampling point.

Parameters

Name

Description

fieldName

Data attribute name.

val

Long integer.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(Field field, int val)

Method

public Builder setFieldValue(Field field, int val)

Sets the integer attribute value of a sampling point.

Parameters

Name

Description

field

Data attribute.

val

Integer.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(String fieldName, int val)

Method

public Builder setFieldValue(String fieldName, int val)

Sets the integer attribute value of a sampling point.

Parameters

Name

Description

fieldName

Data attribute name.

val

Integer.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(Field field, Map<String, Value> mapVal)

Method

public Builder setFieldValue(Field field, Map<String, Value> mapVal)

Sets the mapped attribute value of a sampling point.

Parameters

Name

Description

field

Data attribute.

mapVal

Map.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(String fieldName, Map<String, Value> mapVal)

Method

public Builder setFieldValue(String fieldName, Map<String, Value> mapVal)

Sets the mapped attribute value of a sampling point.

Parameters

Name

Description

fieldName

Data attribute name.

mapVal

Map.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(Field field, String val)

Method

public Builder setFieldValue(Field field, String val)

Sets the string attribute value of a sampling point.

Parameters

Name

Description

field

Data attribute.

val

String.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setFieldValue(String fieldName, String val)

Method

public Builder setFieldValue(String fieldName, String val)

Sets the string attribute value of a sampling point.

Parameters

Name

Description

fieldName

Data attribute name.

val

String.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setId(long id)

Method

public Builder setId(long id)

Sets the ID of the sampling point.

Parameters

Name

Description

id

ID of the sampling point.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setRawDataCollector(DataCollector collector)

Method

public Builder setRawDataCollector(DataCollector collector)

Sets the raw data collector.

Parameters

Name

Description

collector

Data collector.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setSamplingTime(long samplingTime, TimeUnit timeUnit)

Method

public Builder setSamplingTime(long samplingTime, TimeUnit timeUnit)

Sets the sampling timestamp of instantaneous data.

The sampling point time must be later than the UNIX timestamp corresponding to 00:00 on January 1, 2014.

Parameters

Name

Description

samplingTime

Timestamp.

timeUnit

Time unit.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setTimeInterval(long start, long end, TimeUnit timeUnit)

Method

public Builder setTimeInterval(long start, long end, TimeUnit timeUnit)

Sets the sampling timestamp of data within an interval.

1. The start time and end time must be later than the UNIX timestamp corresponding to 00:00 on January 1, 2014.

2. The UNIX timestamp of the end time must be later than that of the start time.

Parameters

Name

Description

start

Start time.

end

End time.

timeUnit

Time unit.

Returns

Type

Description

Builder

SamplePoint.Builder object.

[h2]setMetadata(String metadata)

Method

public Builder setMetadata(String metadata)

Sets the metadata.

Parameters

Name

Description

metadata

Metadata, which can be null, an empty string, or a string of 1 to 10000 characters.

Returns

Type

Description

Builder

SamplePoint.Builder object.