public static String extractDefaultMajorVersionFromRestName(String restName){
  Preconditions.checkNotNull(restName);
  String[] segs=restName.split("\\.");
  if (segs.length == 0) {
    return "v1";
  }
  Matcher matcher=MAJOR_VERSION_REGEX_PATTERN.matcher(segs[0]);
  return matcher.find() ? matcher.group(1) : "v1";
}

public static String extractDefaultMajorVersionFromRestName ( String restName ) { Preconditions . checkNotNull ( restName ) ; String [ ] segs = restName . split ( "\\." ) ; if ( segs . length == 0 ) { return "v1" ; } Matcher matcher = MAJOR_VERSION_REGEX_PATTERN . matcher ( segs [ 0 ] ) ; return matcher . find ( ) ? matcher . group ( 1 ) : "v1" ; }
extract major version from rest element name . rest element name has the form of " v1 . foo . bar " or " foo . bar " . for the later case , " v1 " will be returned .
