@Test public void nameBlacklisted() { IllegalArgumentException iae = assertThrows(IllegalArgumentException.class, () -> builder.name(HtmlLanguage.NAME_HTML)); assertTrue(iae.getMessage().contains("Name must not be equal to " + HtmlLanguage.NAME_HTML)); }
public HtmlLanguageBuilder name(String name) { requireNonNull(name, "Must provide a name"); checkArgument(!Strings.isNullOrEmpty(name), "Name must not be empty"); checkArgument(!name.equalsIgnoreCase(HtmlLanguage.NAME_HTML), "Name must not be equal to %s", HtmlLanguage.NAME_HTML); checkArgument(name.equals(name.trim()), "Name must not have leading or trailing whitespace"); this.name = name; return this; }
HtmlLanguageBuilder { public HtmlLanguageBuilder name(String name) { requireNonNull(name, "Must provide a name"); checkArgument(!Strings.isNullOrEmpty(name), "Name must not be empty"); checkArgument(!name.equalsIgnoreCase(HtmlLanguage.NAME_HTML), "Name must not be equal to %s", HtmlLanguage.NAME_HTML); checkArgument(name.equals(name.trim()), "Name must not have leading or trailing whitespace"); this.name = name; return this; } }
HtmlLanguageBuilder { public HtmlLanguageBuilder name(String name) { requireNonNull(name, "Must provide a name"); checkArgument(!Strings.isNullOrEmpty(name), "Name must not be empty"); checkArgument(!name.equalsIgnoreCase(HtmlLanguage.NAME_HTML), "Name must not be equal to %s", HtmlLanguage.NAME_HTML); checkArgument(name.equals(name.trim()), "Name must not have leading or trailing whitespace"); this.name = name; return this; } HtmlLanguageBuilder(); }
HtmlLanguageBuilder { public HtmlLanguageBuilder name(String name) { requireNonNull(name, "Must provide a name"); checkArgument(!Strings.isNullOrEmpty(name), "Name must not be empty"); checkArgument(!name.equalsIgnoreCase(HtmlLanguage.NAME_HTML), "Name must not be equal to %s", HtmlLanguage.NAME_HTML); checkArgument(name.equals(name.trim()), "Name must not have leading or trailing whitespace"); this.name = name; return this; } HtmlLanguageBuilder(); HtmlLanguageBuilder name(String name); HtmlLanguageBuilder add(BlockType blockType); HtmlLanguageBuilder add(SpanType spanType); HtmlLanguageBuilder addSubstitution(SpanType spanType, String alternativeTagName); HtmlLanguageBuilder addHeadings(int level); HtmlLanguageBuilder addSpanFont(); HtmlLanguageBuilder setXhtmlStrict(boolean xhtmlStrict); HtmlLanguageBuilder document(String prefix, String suffix); HtmlLanguageBuilder setSupportsImages(boolean supportsImages); HtmlLanguage create(); }
HtmlLanguageBuilder { public HtmlLanguageBuilder name(String name) { requireNonNull(name, "Must provide a name"); checkArgument(!Strings.isNullOrEmpty(name), "Name must not be empty"); checkArgument(!name.equalsIgnoreCase(HtmlLanguage.NAME_HTML), "Name must not be equal to %s", HtmlLanguage.NAME_HTML); checkArgument(name.equals(name.trim()), "Name must not have leading or trailing whitespace"); this.name = name; return this; } HtmlLanguageBuilder(); HtmlLanguageBuilder name(String name); HtmlLanguageBuilder add(BlockType blockType); HtmlLanguageBuilder add(SpanType spanType); HtmlLanguageBuilder addSubstitution(SpanType spanType, String alternativeTagName); HtmlLanguageBuilder addHeadings(int level); HtmlLanguageBuilder addSpanFont(); HtmlLanguageBuilder setXhtmlStrict(boolean xhtmlStrict); HtmlLanguageBuilder document(String prefix, String suffix); HtmlLanguageBuilder setSupportsImages(boolean supportsImages); HtmlLanguage create();  }