/** * Add a javadoc tag to the specified documentation block. If the tag is * already defined, this will have no effect. * * @param doc the documentation block * @param tag the tag to add */ private static void addTag(Javadoc doc, JavadocTag tag) { if (!hasTagAlready( requireNonNull(doc), requireNonNull(tag) )) { doc.add(tag); } }
protected Javadoc getJavaDoc() { final String owner; final String message; if (isInGeneratedPackage()) { owner = infoComponent.getTitle(); message = getGeneratedJavadocMessage(); } else { owner = project().orElseThrow(NoSuchElementException::new).getCompanyName(); message = JAVADOC_MESSAGE; } return Javadoc.of(getJavadocRepresentText() + message) .add(AUTHOR.setValue(owner)); }
/** * The <code>hashCode()</code>-part of the <code>accept</code> method. * * @param model the model */ protected void acceptHashcode(T model) { requireNonNull(model); model.add(Method.of(HASHCODE, int.class) .set( Javadoc.of( "Generates a hashCode for this object. If any field is " + "changed to another value, the hashCode may be different. " + "Two objects with the same values are guaranteed to have " + "the same hashCode. Two objects with the same hashCode are " + "not guaranteed to have the same hashCode." ) .add(RETURN.setText("The hash code.")) ).public_() .add(OVERRIDE) .add("int hash = 7;") .add(model.getFields().stream() .map(this::hash) .collect(Collectors.joining(nl())) ) .add("return hash;") ); }
doc.add(AUTHOR.setValue(DEFAULT_NAME));
.set(Javadoc.of() .setText("Adds the specified " + lcfirst(shortName(param.getType().getTypeName())) + " to this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", param.getName(), "the new value")) .add(JavadocTag.of("return", "a reference to this object")) ).public_() .add(param) .set(Javadoc.of() .setText("Sets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", f.getName(), "the new value")) .add(JavadocTag.of("return", "a reference to this object")) ).public_(); .set(Javadoc.of() .setText("Gets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("return", "the " + f.getName())) ).public_() .add("return this." + f.getName() + ";");
+ " field corresponds to the database column " + relativeName(col, Dbms.class, DATABASE_NAME) + "." ).add(RETURN.setText( "the " + getSupport().variableName(col) + " of this " + getSupport().entityName() + relativeName(col, Dbms.class, DATABASE_NAME) + "." .add(PARAM.setValue(getSupport().variableName(col)).setText("to set of this " + getSupport().entityName())) .add(RETURN.setText("this " + getSupport().entityName() + " instance"))) + fuSupport.entityName() + " exists, an {@code NullPointerException} will be thrown." ).add(DefaultJavadocTag.PARAM.setValue("foreignManager").setText("the manager to query for the entity")) .add(DefaultJavadocTag.RETURN.setText("the foreign entity referenced"))
/** * Add a javadoc tag to the specified documentation block. If the tag is * already defined, this will have no effect. * * @param doc the documentation block * @param tag the tag to add */ private static void addTag(Javadoc doc, JavadocTag tag) { if (!hasTagAlready( requireNonNull(doc), requireNonNull(tag) )) { doc.add(tag); } }
/** * Add a javadoc tag to the specified documentation block. If the tag is * already defined, this will have no effect. * * @param doc the documentation block * @param tag the tag to add */ private static void addTag(Javadoc doc, JavadocTag tag) { if (!hasTagAlready( requireNonNull(doc), requireNonNull(tag) )) { doc.add(tag); } }
/** * The <code>hashCode()</code>-part of the <code>accept</code> method. * * @param model the model */ protected void acceptHashcode(T model) { requireNonNull(model); model.add(Method.of(HASHCODE, int.class) .set( Javadoc.of( "Generates a hashCode for this object. If any field is " + "changed to another value, the hashCode may be different. " + "Two objects with the same values are guaranteed to have " + "the same hashCode. Two objects with the same hashCode are " + "not guaranteed to have the same hashCode." ) .add(RETURN.setText("The hash code.")) ).public_() .add(OVERRIDE) .add("int hash = 7;") .add(model.getFields().stream() .map(this::hash) .collect(Collectors.joining(nl())) ) .add("return hash;") ); }
/** * The <code>hashCode()</code>-part of the <code>accept</code> method. * * @param model the model */ protected void acceptHashcode(T model) { requireNonNull(model); model.add(Method.of(HASHCODE, int.class) .set( Javadoc.of( "Generates a hashCode for this object. If any field is " + "changed to another value, the hashCode may be different. " + "Two objects with the same values are guaranteed to have " + "the same hashCode. Two objects with the same hashCode are " + "not guaranteed to have the same hashCode." ) .add(RETURN.setText("The hash code.")) ).public_() .add(OVERRIDE) .add("int hash = 7;") .add(model.getFields().stream() .map(this::hash) .collect(Collectors.joining(nl())) ) .add("return hash;") ); }
doc.add(AUTHOR.setValue(DEFAULT_NAME));
doc.add(AUTHOR.setValue(DEFAULT_NAME));
.set(Javadoc.of() .setText("Adds the specified " + lcfirst(shortName(param.getType().getTypeName())) + " to this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", param.getName(), "the new value")) .add(JavadocTag.of("return", "a reference to this object")) ).public_() .add(param) .set(Javadoc.of() .setText("Sets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", f.getName(), "the new value")) .add(JavadocTag.of("return", "a reference to this object")) ).public_(); .set(Javadoc.of() .setText("Gets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("return", "the " + f.getName())) ).public_() .add("return this." + f.getName() + ";");
.set(Javadoc.of() .setText("Adds the specified " + lcfirst(shortName(param.getType().getTypeName())) + " to this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", param.getName(), "the new value")) .add(JavadocTag.of("return", "a reference to this object")) ).public_() .add(param) .set(Javadoc.of() .setText("Sets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", f.getName(), "the new value")) .add(JavadocTag.of("return", "a reference to this object")) ).public_(); .set(Javadoc.of() .setText("Gets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("return", "the " + f.getName())) ).public_() .add("return this." + f.getName() + ";");
+ " field corresponds to the database column " + relativeName(col, Dbms.class, DATABASE_NAME) + "." ).add(RETURN.setText( "the " + getSupport().variableName(col) + " of this " + getSupport().entityName() + relativeName(col, Dbms.class, DATABASE_NAME) + "." .add(PARAM.setValue(getSupport().variableName(col)).setText("to set of this " + getSupport().entityName())) .add(RETURN.setText("this " + getSupport().entityName() + " instance"))) + fuSupport.entityName() + " exists, an {@code NullPointerException} will be thrown." ).add(DefaultJavadocTag.PARAM.setValue("foreignManager").setText("the manager to query for the entity")) .add(DefaultJavadocTag.RETURN.setText("the foreign entity referenced"))