Tabnine Logo
ValueType.isNumeric
Code IndexAdd Tabnine to your IDE (free)

How to use
isNumeric
method
in
org.hisp.dhis.common.ValueType

Best Java code snippets using org.hisp.dhis.common.ValueType.isNumeric (Showing top 18 results out of 315)

origin: dhis2/dhis2-core

/**
 * Indicates whether the value type of this attribute is numeric.
 */
public boolean isNumericType()
{
  return valueType.isNumeric();
}
origin: dhis2/dhis2-core

public boolean isNumeric()
{
  return valueType.isNumeric();
}
origin: dhis2/dhis2-core

/**
 * Indicates whether the value type of this data element is numeric.
 */
public boolean isNumericType()
{
  return getValueType().isNumeric();
}
origin: dhis2/dhis2-core

/**
 * Indicates whether the value is a zero.
 */
public boolean isZero()
{
  return dataElement != null && dataElement.getValueType().isNumeric() && value != null && ZERO_PATTERN.matcher( value ).find();
}
origin: dhis2/dhis2-core

/**
 * 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'";
  }
}
origin: dhis2/dhis2-core

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;
}
origin: dhis2/dhis2-core

/**
 * 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 );
}
origin: dhis2/dhis2-core

if ( !dataElement.getValueType().isNumeric() )
origin: dhis2/dhis2-core

if ( valueType.isText() || valueType.isNumeric() || ValueType.USERNAME == valueType )
origin: dhis2/dhis2-core

if ( dataElement.getValueType().isNumeric() && stdDevFactor != null )
origin: dhis2/dhis2-core

if ( dataElement.getValueType().isNumeric() )
origin: dhis2/dhis2-core

else if ( valueType.isText() || valueType.isNumeric() || ValueType.USERNAME == valueType )
origin: dhis2/dhis2-core

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() : "";
}
origin: dhis2/dhis2-core

  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() : "";
  }
}
origin: dhis2/dhis2-core

else if ( type.isNumeric() )
origin: dhis2/dhis2-core

  CategoryOptionCombo attributeOptionCombo, OrganisationUnit organisationUnit, Period lastPeriod, int historyLength )
if ( !dataElement.getValueType().isNumeric() )
origin: dhis2/dhis2-core

if ( dv.getDataElement().getValueType().isNumeric() )
origin: dhis2/dhis2-core

else if ( valueType.isNumeric() )
org.hisp.dhis.commonValueTypeisNumeric

Javadoc

Includes integer and decimal types.

Popular methods of ValueType

  • isFile
  • isText
  • isBoolean
  • isDate
  • isInteger
  • equals
  • toString
  • getJavaClass
  • hashCode
  • isAggregateable
  • isDecimal
  • isGeo
  • isDecimal,
  • isGeo,
  • isOrganisationUnit,
  • name,
  • valueOf

Popular in Java

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Reference (javax.naming)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now