/** * Checks if the specified tag is already defined in the supplied * documentation block. * * @param doc the documentation block * @param tag the tag to check * @return {@code true} if it exists, else {@code false} */ private static boolean hasTagAlready(Javadoc doc, JavadocTag tag) { requireNonNull(doc); requireNonNull(tag); return doc.getTags().stream().anyMatch(t -> tag.getName().equals(t.getName()) && tag.getValue().equals(t.getValue()) ); } }
@Override public Optional<String> transform(Generator gen, JavadocTag model) { requireNonNull(gen); requireNonNull(model); return Optional.of( "@" + model.getName() + ifelse(model.getValue(), s -> " " + s, "") + " " + model.getText().orElse("") ); } }
JavadocTagBase(JavadocTag prototype) { requireNonNull(prototype); this.name = prototype.getName(); this.value = prototype.getValue().orElse(null); this.text = prototype.getText().orElse(null); this.imports = Copier.copy(prototype.getImports()); }
/** * Checks if the specified tag is already defined in the supplied * documentation block. * * @param doc the documentation block * @param tag the tag to check * @return {@code true} if it exists, else {@code false} */ private static boolean hasTagAlready(Javadoc doc, JavadocTag tag) { requireNonNull(doc); requireNonNull(tag); return doc.getTags().stream().anyMatch(t -> tag.getName().equals(t.getName()) && tag.getValue().equals(t.getValue()) ); } }
JavadocTagBase(JavadocTag prototype) { requireNonNull(prototype); this.name = prototype.getName(); this.value = prototype.getValue().orElse(null); this.text = prototype.getText().orElse(null); }
/** * Checks if the specified tag is already defined in the supplied * documentation block. * * @param doc the documentation block * @param tag the tag to check * @return {@code true} if it exists, else {@code false} */ private static boolean hasTagAlready(Javadoc doc, JavadocTag tag) { requireNonNull(doc); requireNonNull(tag); return doc.getTags().stream().anyMatch(t -> tag.getName().equals(t.getName()) && tag.getValue().equals(t.getValue()) ); } }
@Override public Optional<String> transform(Generator gen, JavadocTag model) { requireNonNull(gen); requireNonNull(model); return Optional.of( "@" + model.getName() + ifelse(model.getValue(), s -> " " + s, "") + " " + model.getText().orElse("") ); } }
@Override public Optional<String> transform(Generator gen, JavadocTag model) { requireNonNull(gen); requireNonNull(model); return Optional.of( "@" + model.getName() + ifelse(model.getValue(), s -> " " + s, "") + " " + model.getText().orElse("") ); } }
JavadocTagBase(JavadocTag prototype) { requireNonNull(prototype); this.name = prototype.getName(); this.value = prototype.getValue().orElse(null); this.text = prototype.getText().orElse(null); this.imports = Copier.copy(prototype.getImports()); }