/** * Indicates whether the value type of this attribute is numeric. */ public boolean isNumericType() { return valueType.isNumeric(); }
public boolean isNumeric() { return valueType.isNumeric(); }
/** * Indicates whether the value type of this data element is numeric. */ public boolean isNumericType() { return getValueType().isNumeric(); }
/** * Indicates whether the value is a zero. */ public boolean isZero() { return dataElement != null && dataElement.getValueType().isNumeric() && value != null && ZERO_PATTERN.matcher( value ).find(); }
/** * Returns a string useful for substitution. * * @param valueType the value type. * @return the string. */ public static String getSubstitutionValue( ValueType valueType ) { if ( valueType.isNumeric() || valueType.isBoolean() ) { return "1"; } else if ( valueType.isDate() ) { return "'2000-01-01'"; } else { return "'A'"; } }
private RuleValueType toMappedValueType( ProgramRuleVariable programRuleVariable ) { ValueType valueType = VALUE_TYPE_MAPPER.getOrDefault( programRuleVariable.getSourceType(), prv -> ValueType.TEXT ).apply( programRuleVariable ); if ( valueType.isBoolean() ) { return RuleValueType.BOOLEAN; } if ( valueType.isText() ) { return RuleValueType.TEXT; } if ( valueType.isNumeric() ) { return RuleValueType.NUMERIC; } return RuleValueType.TEXT; }
/** * Indicates whether the given value is zero and not zero significant according * to its data element. * * @param value the data value. * @param dataElement the data element. */ public static boolean dataValueIsZeroAndInsignificant( String value, DataElement dataElement ) { AggregationType aggregationType = dataElement.getAggregationType(); return dataElement.getValueType().isNumeric() && MathUtils.isZero( value ) && !dataElement.isZeroIsSignificant() && !( aggregationType == AggregationType.AVERAGE_SUM_ORG_UNIT || aggregationType == AggregationType.AVERAGE ); }
if ( !dataElement.getValueType().isNumeric() )
if ( valueType.isText() || valueType.isNumeric() || ValueType.USERNAME == valueType )
if ( dataElement.getValueType().isNumeric() && stdDevFactor != null )
if ( dataElement.getValueType().isNumeric() )
else if ( valueType.isText() || valueType.isNumeric() || ValueType.USERNAME == valueType )
private String getTrackedEntityAttributeValue( TrackedEntityAttributeValue attributeValue ) { ValueType valueType = attributeValue.getAttribute().getValueType(); if ( valueType.isBoolean() ) { return attributeValue.getValue() != null ? attributeValue.getValue() : "false"; } if ( valueType.isNumeric() ) { return attributeValue.getValue() != null ? attributeValue.getValue() : "0"; } return attributeValue.getValue() != null ? attributeValue.getValue() : ""; }
private String getTrackedEntityDataValue( TrackedEntityDataValue dataValue ) { ValueType valueType = dataValue.getDataElement().getValueType(); if ( valueType.isBoolean() ) { return dataValue.getValue() != null ? dataValue.getValue() : "false"; } if ( valueType.isNumeric() ) { return dataValue.getValue() != null ? dataValue.getValue() : "0"; } return dataValue.getValue() != null ? dataValue.getValue() : ""; } }
else if ( type.isNumeric() )
CategoryOptionCombo attributeOptionCombo, OrganisationUnit organisationUnit, Period lastPeriod, int historyLength ) if ( !dataElement.getValueType().isNumeric() )
if ( dv.getDataElement().getValueType().isNumeric() )
else if ( valueType.isNumeric() )