public boolean isVersionValid(String version){
  if (fromVersion != null && version != null) {
    if (version.compareTo(fromVersion) < 0) {
      return false;
    }
  }
  if (toVersion != null) {
    if (version == null || version.compareTo(toVersion) >= 0) {
      return false;
    }
  }
  return true;
}

public boolean isVersionValid ( String version ) { if ( fromVersion != null && version != null ) { if ( version . compareTo ( fromVersion ) < 0 ) { return false ; } } if ( toVersion != null ) { if ( version == null || version . compareTo ( toVersion ) >= 0 ) { return false ; } } return true ; }
this method determines if the rule is valid for the supplied version . if the supplied version is null , then it is assumed to represent ' latest version ' and therefore any rule with a ' toversion ' set will not be valid .
