code: public HttpMediaType setType(String type) {
      Preconditions.checkArgument(
          TYPE_REGEX.matcher(type).matches(), "Type contains reserved characters");
      this.type = type;
      cachedBuildResult = null;
      return this;
    }
docs: Sets the (main) media type, for example {@code "text"}.
  
  @param type main/major media type