test_class.file: everrest-core/src/test/java/org/everrest/core/impl/header/AcceptLanguageHeaderDelegateTest.java
test_class.identifier: AcceptLanguageHeaderDelegateTest
test_case.body: @Test(expected = IllegalArgumentException.class)
      public void throwExceptionWhenAcceptLanguageHeaderIsNull() {
          new AcceptLanguageHeaderDelegate().fromString(null);
      }
test_case.class_method_signature: AcceptLanguageHeaderDelegateTest.throwExceptionWhenAcceptLanguageHeaderIsNull()
test_case.full_signature: @Test(expected = IllegalArgumentException.class) public void throwExceptionWhenAcceptLanguageHeaderIsNull()
test_case.identifier: throwExceptionWhenAcceptLanguageHeaderIsNull
test_case.invocations: fromString
test_case.modifiers: @Test(expected = IllegalArgumentException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void throwExceptionWhenAcceptLanguageHeaderIsNull()
focal_class.declarator: QUALITY_SEPARATOR = ';'
focal_class.modifier: private static final
focal_class.original_string: private static final char QUALITY_SEPARATOR = ';';
focal_class.type: char
focal_class.var_name: QUALITY_SEPARATOR
focal_class.declarator: SUB_TAG_SEPARATOR = '-'
focal_class.modifier: private static final
focal_class.original_string: private static final char SUB_TAG_SEPARATOR = '-';
focal_class.type: char
focal_class.var_name: SUB_TAG_SEPARATOR
focal_class.file: everrest-core/src/main/java/org/everrest/core/impl/header/AcceptLanguageHeaderDelegate.java
focal_class.identifier: AcceptLanguageHeaderDelegate
focal_class.interfaces: implements RuntimeDelegate.HeaderDelegate<AcceptLanguage>
focal_class.class_method_signature: AcceptLanguageHeaderDelegate.fromString(String header)
focal_class.full_signature: @Override public AcceptLanguage fromString(String header)
focal_class.identifier: fromString
focal_class.modifiers: @Override public
focal_class.parameters: (String header)
focal_class.return: AcceptLanguage
focal_class.signature: AcceptLanguage fromString(String header)
focal_class.class_method_signature: AcceptLanguageHeaderDelegate.toString(AcceptLanguage language)
focal_class.full_signature: @Override public String toString(AcceptLanguage language)
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: (AcceptLanguage language)
focal_class.return: String
focal_class.signature: String toString(AcceptLanguage language)
focal_method.body: @Override
      public AcceptLanguage fromString(String header) {
          if (header == null) {
              throw new IllegalArgumentException();
          }
  
          try {
              header = HeaderHelper.removeWhitespaces(header);
              String tag;
              Map<String, String> params = null;
  
              int p = scan(header, QUALITY_SEPARATOR);
              if (charAtIs(header, p, QUALITY_SEPARATOR)) {
                  tag = header.substring(0, p);
                  params = new HeaderParameterParser().parse(header);
              } else {
                  tag = header;
              }
  
              String lang;
              String country = null;
  
              p = scan(header, SUB_TAG_SEPARATOR);
              if (charAtIs(header, p, SUB_TAG_SEPARATOR)) {
                  lang = tag.substring(0, p);
                  country = tag.substring(p + 1);
              } else {
                  lang = tag;
              }
  
              if (params == null || params.get(QVALUE) == null) {
                  return new AcceptLanguage(new Language(new Locale(lang, nullToEmpty(country))));
              }
  
              return new AcceptLanguage(new Locale(lang, nullToEmpty(country)), parseQualityValue(params.get(QVALUE)));
          } catch (ParseException e) {
              throw new IllegalArgumentException("Accept language header malformed");
          }
      }
focal_method.class_method_signature: AcceptLanguageHeaderDelegate.fromString(String header)
focal_method.full_signature: @Override public AcceptLanguage fromString(String header)
focal_method.identifier: fromString
focal_method.invocations: removeWhitespaces scan charAtIs substring parse scan charAtIs substring substring get nullToEmpty nullToEmpty parseQualityValue get
focal_method.modifiers: @Override public
focal_method.parameters: (String header)
focal_method.return: AcceptLanguage
focal_method.signature: AcceptLanguage fromString(String header)