Fluent builder for a Metric, obtained from newMetricBuilder or QueryManager.newMetricBuilder. Configure the required properties and call build to produce the immutable Metric instance. If durationUnit is set, build also assembles the metric's MetricCacheConfig, and its MetricPrecalcConfig if precalcDataSeriesName is set.

Group: Builders


Properties

PropertyReturnsDescription
appliesToSet<String>The appliesTo identifiers configured on this builder so far.
dateModeDateModeThe date mode configured on this builder so far.
decimalsintThe number of decimal places configured on this builder so far.
endDateDateThe constant end date configured on this builder so far.
entityNameStringThe entity name configured on this builder so far.
entitySelectionEntitySelectionThe entity selection configured on this builder so far.
iconStringThe icon configured on this builder so far.
idStringThe metric id configured on this builder so far.
metricTypeIdStringThe metric type id configured on this builder so far.
notesStringThe notes configured on this builder so far.
paramsMap<String,String>The calculation parameters configured on this builder so far.
startDateDateThe constant start date configured on this builder so far.
titleStringThe title configured on this builder so far.
unitStringThe unit label configured on this builder so far.
unitPositionUnitPositionThe unit position configured on this builder so far.

Methods

build() · precalcDurationUnit(String s) · precalcDurationMultiple(Integer s) · precalcRunAsUser(String s) · precalcEntityType(String type) · durationUnit(TimeUnit units) · ignoreDates(boolean b) · decimals(int s) · id(String s) · title(String s) · icon(String s) · metricTypeId(String s) · entitySelection(EntitySelection s) · entitySelection(String s) · entityName(String s) · dateMode(DateMode s) · startDate(Date s) · endDate(Date s) · params(Map<String,String> s) · appliesTo(Set<String> s) · notes(String s) · param(String key, String value) · appliesTo(NamedObject ob) · unit(String s) · unitPosition(UnitPosition s) · unitPosition(String s) · getId() · getTitle() · getIcon() · getDecimals() · getMetricTypeId() · getEntitySelection() · getEntityName() · getDateMode() · getStartDate() · getEndDate() · getParams() · getAppliesTo() · getNotes() · getUnit() · getUnitPosition()

build()

Returns: Metric

Builds the immutable Metric from the values configured on this builder. If durationUnit has been set, this also assembles the metric's MetricCacheConfig, and a MetricPrecalcConfig if precalcDataSeriesName is set.

precalcDurationUnit(String s)

Returns: MetricBuilder

Sets the time unit used to bucket pre-calculated data for this metric.

ParameterDescription
sthe name of a MetricCacheConfig.TimeUnit value

precalcDurationMultiple(Integer s)

Returns: MetricBuilder

Sets how many precalcDurationUnit periods elapse between pre-calculation runs.

ParameterDescription
sthe duration multiple

precalcRunAsUser(String s)

Returns: MetricBuilder

Sets the user the pre-calculation process runs as.

ParameterDescription
sthe username to run pre-calculation as

precalcEntityType(String type)

Returns: MetricBuilder

Adds an entity type (an org type or group name) that this metric should be pre-calculated for.

ParameterDescription
typethe entity type to add

durationUnit(TimeUnit units)

Returns: MetricBuilder

Sets the time unit used to bucket this metric's cache, enabling caching for this metric.

ParameterDescription
unitsthe cache duration unit

ignoreDates(boolean b)

Returns: MetricBuilder

Sets whether the metric's cache ignores the requested date range.

ParameterDescription
btrue to ignore dates when reading or writing the cache

decimals(int s)

Returns: MetricBuilder

Sets the number of decimal places the calculated value should be displayed with.

ParameterDescription
sthe number of decimal places

id(String s)

Returns: MetricBuilder

Sets the metric's unique identifier.

ParameterDescription
sthe metric id

title(String s)

Returns: MetricBuilder

Sets the metric's display title.

ParameterDescription
sthe title

icon(String s)

Returns: MetricBuilder

Sets the icon shown alongside the metric, typically a font icon class name such as "fa-users".

ParameterDescription
sthe icon

metricTypeId(String s)

Returns: MetricBuilder

Sets the id of the MetricType that calculates this metric's value.

ParameterDescription
sthe metric type id

entitySelection(EntitySelection s)

Returns: MetricBuilder

Sets which entity this metric is calculated against.

ParameterDescription
sthe entity selection

entitySelection(String s)

Returns: MetricBuilder

Sets which entity this metric is calculated against, given as the name of an EntitySelection value.

ParameterDescription
sthe name of an EntitySelection value

entityName(String s)

Returns: MetricBuilder

Sets the name of the entity this metric applies to, used with the specifiedProfile and specifiedOrg entity selections.

ParameterDescription
sthe entity name

dateMode(DateMode s)

Returns: MetricBuilder

Sets how the date range for this metric's calculation is derived.

ParameterDescription
sthe date mode

startDate(Date s)

Returns: MetricBuilder

Sets a constant start date to use instead of the standard query dates.

ParameterDescription
sthe start date

endDate(Date s)

Returns: MetricBuilder

Sets a constant end date to use instead of the standard query dates.

ParameterDescription
sthe end date

params(Map<String,String> s)

Returns: MetricBuilder

Sets the additional parameters passed through to the metric type's calculation function.

ParameterDescription
sa map of parameter name to value

appliesTo(Set<String> s)

Returns: MetricBuilder

Sets the identifiers for what this metric is used for.

ParameterDescription
sthe set of identifiers this metric applies to

notes(String s)

Returns: MetricBuilder

Sets free text notes about this metric.

ParameterDescription
sthe notes

param(String key, String value)

Returns: MetricBuilder

Adds a single key and value to this metric's params map, creating the map if it does not already exist.

ParameterDescription
keythe parameter name
valuethe parameter value

appliesTo(NamedObject ob)

Returns: MetricBuilder

Adds an identifier for the given named object to this metric's appliesTo set, formed from the object's class name and its object name.

ParameterDescription
obthe object this metric applies to

unit(String s)

Returns: MetricBuilder

Sets the unit label shown alongside the metric's value.

ParameterDescription
sthe unit label

unitPosition(UnitPosition s)

Returns: MetricBuilder

Sets whether the unit label is displayed before or after the value.

ParameterDescription
sthe unit position

unitPosition(String s)

Returns: MetricBuilder

Sets whether the unit label is displayed before or after the value, given as the name of a UnitPosition value.

ParameterDescription
sthe name of a UnitPosition value

getId()

Returns: String

The metric id configured on this builder so far.

getTitle()

Returns: String

The title configured on this builder so far.

getIcon()

Returns: String

The icon configured on this builder so far.

getDecimals()

Returns: int

The number of decimal places configured on this builder so far.

getMetricTypeId()

Returns: String

The metric type id configured on this builder so far.

getEntitySelection()

Returns: EntitySelection

The entity selection configured on this builder so far.

getEntityName()

Returns: String

The entity name configured on this builder so far.

getDateMode()

Returns: DateMode

The date mode configured on this builder so far.

getStartDate()

Returns: Date

The constant start date configured on this builder so far.

getEndDate()

Returns: Date

The constant end date configured on this builder so far.

getParams()

Returns: Map<String,String>

The calculation parameters configured on this builder so far.

getAppliesTo()

Returns: Set<String>

The appliesTo identifiers configured on this builder so far.

getNotes()

Returns: String

The notes configured on this builder so far.

getUnit()

Returns: String

The unit label configured on this builder so far.

getUnitPosition()

Returns: UnitPosition

The unit position configured on this builder so far.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.