Codota Logo
ValueType.equals
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: dhis2/dhis2-core

public static boolean validateValueType( TextPattern textPattern, ValueType valueType )
{
  if ( ValueType.TEXT.equals( valueType ) )
  {
    return true;
  }
  else if ( ValueType.NUMBER.equals( valueType ) )
  {
    boolean isAllNumbers = true;
    for ( TextPatternSegment segment : textPattern.getSegments() )
    {
      isAllNumbers = isAllNumbers && isNumericOnly( segment );
    }
    return isAllNumbers;
  }
  else
  {
    return false;
  }
}
origin: dhis2/dhis2-core

@Override
public boolean equals( Object o )
{
  if ( this == o )
    return true;
  if ( o == null || getClass() != o.getClass() )
    return false;
  Attribute attribute1 = (Attribute) o;
  if ( attribute != null ? !attribute.equals( attribute1.attribute ) : attribute1.attribute != null )
  {
    return false;
  }
  if ( displayName != null ? !displayName.equals( attribute1.displayName ) : attribute1.displayName != null )
  {
    return false;
  }
  if ( valueType != null ? !valueType.equals( attribute1.valueType ) : attribute1.valueType != null )
  {
    return false;
  }
  if ( code != null ? !code.equals( attribute1.code ) : attribute1.code != null )
  {
    return false;
  }
  if ( value != null ? !value.equals( attribute1.value ) : attribute1.value != null )
  {
    return false;
  }
  return true;
}
origin: dhis2/dhis2-core

private List<TrackedEntityInstance> getTrackedEntityInstanceByPhoneNumber( IncomingSms sms, SMSCommand command, Set<OrganisationUnit> ous )
{
  List<TrackedEntityAttribute> attributes = trackedEntityAttributeService.getAllTrackedEntityAttributes().stream()
    .filter( attr -> attr.getValueType().equals( ValueType.PHONE_NUMBER ) )
    .collect( Collectors.toList() );
  List<TrackedEntityInstance> teis = new ArrayList<>();
  attributes.parallelStream()
    .map( attr -> getParams( attr, sms, command.getProgram(), ous ) )
    .forEach( param -> teis.addAll( trackedEntityInstanceService.getTrackedEntityInstances( param, false ) ) );
  return teis;
}
origin: dhis2/dhis2-core

public String getTrackedEntityInstanceRecipient( TrackedEntityInstance tei, ValueType type )
{
  Set<TrackedEntityAttributeValue> attributeValues = tei.getTrackedEntityAttributeValues();
  for ( TrackedEntityAttributeValue value : attributeValues )
  {
    if ( value != null && value.getAttribute().getValueType().equals( type ) &&
      value.getPlainValue() != null && !value.getPlainValue().trim().isEmpty() )
    {
      return value.getPlainValue();
    }
  }
  throw new IllegalQueryException( "Tracked entity does not have any attribute of value type: " + type.toString() );
}
origin: dhis2/dhis2-core

@Override
public <T extends IdentifiableObject> List<ErrorReport> validate( T object, ObjectBundle bundle )
{
  List<ErrorReport> errorReports = new ArrayList<>();
  // Validate that the RenderType (if any) conforms to the constraints of ValueType or OptionSet.
  if ( object != null && object.getClass().isAssignableFrom( TrackedEntityAttribute.class ) )
  {
    TrackedEntityAttribute attr = (TrackedEntityAttribute) object;
    if ( attr.isGenerated() && !attr.getValueType().equals( ValueType.TEXT ) )
    {
      errorReports.add( new ErrorReport( TrackedEntityAttribute.class, ErrorCode.E4010, "generated", attr.getValueType() ) );
    }
    errorReports.addAll( textPatternValid( attr ) );
    if ( attr.getFieldMask() != null )
    {
      try
      {
        TextPatternParser.parse( "\"" + attr.getFieldMask() + "\"" );
      }
      catch ( TextPatternParser.TextPatternParsingException e )
      {
        errorReports.add( new ErrorReport( TrackedEntityAttribute.class, ErrorCode.E4019, attr.getFieldMask(), "Not a valid TextPattern 'TEXT' segment." ));
      }
    }
  }
  return errorReports;
}
org.hisp.dhis.commonValueTypeequals

Popular methods of ValueType

  • isNumeric
    Includes integer and decimal types.
  • isFile
  • isText
  • isBoolean
  • isDate
  • isInteger
  • toString
  • getJavaClass
  • hashCode
  • isAggregateable
  • isDecimal
  • isGeo
  • isDecimal,
  • isGeo,
  • isOrganisationUnit,
  • name,
  • valueOf

Popular in Java

  • Making http post requests using okhttp
  • startActivity (Activity)
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now