@Override public int compareTo(@Nullable ObsValue other){
  if (other == null)   return 1;
  int result=0;
  result=Integer.compare(getTypeOrdering(),other.getTypeOrdering());
  if (result != 0)   return result;
  if (uuid != null) {
    result=Integer.compare(getUuidOrdering(),other.getUuidOrdering());
    if (result != 0)     return result;
    result=uuid.compareTo(other.uuid);
  }
 else   if (number != null) {
    result=Double.compare(number,other.number);
  }
 else   if (text != null) {
    result=text.compareTo(other.text);
  }
 else   if (date != null) {
    result=date.compareTo(other.date);
  }
 else   if (instant != null) {
    result=instant.compareTo(other.instant);
  }
  return result;
}

@ Override public int compareTo ( @ Nullable ObsValue other ) { if ( other == null ) return 1 ; int result = 0 ; result = Integer . compare ( getTypeOrdering ( ) , other . getTypeOrdering ( ) ) ; if ( result != 0 ) return result ; if ( uuid != null ) { result = Integer . compare ( getUuidOrdering ( ) , other . getUuidOrdering ( ) ) ; if ( result != 0 ) return result ; result = uuid . compareTo ( other . uuid ) ; } else if ( number != null ) { result = Double . compare ( number , other . number ) ; } else if ( text != null ) { result = text . compareTo ( other . text ) ; } else if ( date != null ) { result = date . compareTo ( other . date ) ; } else if ( instant != null ) { result = instant . compareTo ( other . instant ) ; } return result ; }
compares obsvalue instances according to a total ordering such that : - all non - null values are greater than null . - the lowest value is the " false " boolean value ( encoded as the coded concept for " no " ) . - next are all coded values , ordered from least severe to most severe ( if they can be interpreted as having a severity ) ; or from first to last ( if they can be interpreted as having a typical temporal sequence ) . - next is the " true " boolean value ( encoded as the coded concept for " yes " ) . - next are all numeric values , ordered from least to greatest . - next are all text values , ordered lexicographically from a to z . - next are all date values , ordered from least to greatest . - next are all instant values , ordered from least to greatest .
