Class ExpressionConfig
The DatumSamplePropertyConfig.getConfig() value represents the expression to evaluate.
- Since:
- 1.79
- Version:
- 2.0
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ExpressionConfig(String name, net.solarnetwork.domain.datum.DatumSamplesType propertyType, String expression, String expressionServiceId) Construct with values. -
Method Summary
Modifier and TypeMethodDescriptionstatic URIexpressionReferenceLink(Class<?> clazz) Get a link to an expression service guide.net.solarnetwork.domain.datum.DatumSamplesTypeGet the datum property type.Get the property type key.Get the expression.net.solarnetwork.service.support.ExpressionServiceExpressiongetExpression(Iterable<net.solarnetwork.service.ExpressionService> services) Get the appropriateExpressionto use for this property configuration, if an expression is configured and the appropriate service is available.Get theExpressionServiceID to use when evaluatinggetExpression().getName()Get the datum property name used for this configuration.voidsetDatumPropertyType(net.solarnetwork.domain.datum.DatumSamplesType datumPropertyType) Set the datum property type.voidSet the property type via a key value.voidsetExpression(String expression) Set the expression.voidsetExpressionServiceId(String expressionServiceId) Set theExpressionServiceID to use when evaluatinggetExpression().voidSet the datum property name to use.static List<net.solarnetwork.settings.SettingSpecifier>settings(Class<?> clazz, String prefix, Iterable<net.solarnetwork.service.ExpressionService> expressionServices) Get settings suitable for configuring an instance of this class.toSettingValues(String providerId, String instanceId, String prefix) Generate a list of setting values from this instance.Methods inherited from class net.solarnetwork.domain.datum.DatumSamplePropertyConfig
getConfig, getPropertyKey, getPropertyType, getPropertyTypeKey, setConfig, setPropertyKey, setPropertyType, setPropertyTypeKey, toString
-
Constructor Details
-
ExpressionConfig
public ExpressionConfig()Default constructor. -
ExpressionConfig
public ExpressionConfig(String name, net.solarnetwork.domain.datum.DatumSamplesType propertyType, String expression, String expressionServiceId) Construct with values.- Parameters:
name- the datum property namepropertyType- the datum property typeexpression- the expressionexpressionServiceId- the expression service ID
-
-
Method Details
-
settings
public static List<net.solarnetwork.settings.SettingSpecifier> settings(Class<?> clazz, String prefix, Iterable<net.solarnetwork.service.ExpressionService> expressionServices) Get settings suitable for configuring an instance of this class.- Parameters:
clazz- the class to get the relative ExpressionConfig.properties resource fromprefix- a setting key prefix to useexpressionServices- the available expression services- Returns:
- the settings, never null
-
toSettingValues
Generate a list of setting values from this instance.- Parameters:
providerId- the setting provider key to useinstanceId- the setting provider instance key to useprefix- a prefix to append to all setting keys- Returns:
- the list of setting values, never null
- Since:
- 1.1
-
expressionReferenceLink
Get a link to an expression service guide.- Parameters:
clazz- the class to get the relative ExpressionConfig.properties resource from- Returns:
- a link to an expression guide
-
getExpression
public net.solarnetwork.service.support.ExpressionServiceExpression getExpression(Iterable<net.solarnetwork.service.ExpressionService> services) Get the appropriateExpressionto use for this property configuration, if an expression is configured and the appropriate service is available.- Parameters:
services- the available services- Returns:
- the expression instance, or null if no expression configured or the appropriate service is not found
- Since:
- 1.1
-
getName
Get the datum property name used for this configuration.This is an alias for
DatumSamplePropertyConfig.getPropertyKey().- Returns:
- the property name
-
setName
Set the datum property name to use.This is an alias for
DatumSamplePropertyConfig.setPropertyKey(String).- Parameters:
name- the property name
-
getExpression
Get the expression.This is an alias for
DatumSamplePropertyConfig.getConfig().- Returns:
- the expression
-
setExpression
Set the expression.This is an alias for
DatumSamplePropertyConfig.setConfig(Object).- Parameters:
expression- the expression to set
-
getExpressionServiceId
Get theExpressionServiceID to use when evaluatinggetExpression().- Returns:
- the service ID
-
setExpressionServiceId
Set theExpressionServiceID to use when evaluatinggetExpression().- Parameters:
expressionServiceId- the service ID, or null to not evaluate
-
getDatumPropertyType
public net.solarnetwork.domain.datum.DatumSamplesType getDatumPropertyType()Get the datum property type.This is an alias for
DatumSamplePropertyConfig.getPropertyType().- Returns:
- the type
-
setDatumPropertyType
public void setDatumPropertyType(net.solarnetwork.domain.datum.DatumSamplesType datumPropertyType) Set the datum property type.This is an alias for
DatumSamplePropertyConfig.setPropertyType(DatumSamplesType), and ignores a null argument.- Parameters:
datumPropertyType- the datum property type to set
-
getDatumPropertyTypeKey
Get the property type key.This returns the configured
DatumSamplePropertyConfig.getPropertyType()DatumSamplesType.toKey()value as a string. If the type is not available,DatumSamplesType.Instantaneouswill be returned.- Returns:
- the property type key
-
setDatumPropertyTypeKey
Set the property type via a key value.This uses the first character of
keyas aDatumSamplesTypekey value to callDatumSamplePropertyConfig.setPropertyType(DatumSamplesType). If there is any problem parsing the type,DatumSamplesType.Instantaneousis set.- Parameters:
key- the datum property type key to set
-