Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public RecordModel(
this.type = type;
this.isImported = isImported;
this.components = components;
importTypes.add("io.avaje.recordbuilder.Generated");
}

void initialImports() {
Expand Down Expand Up @@ -70,8 +71,8 @@ String fields(Map<String, String> defaultsMap) {
}

builder.append(
" private %s %s%s; // -- %s\n"
.formatted(uType.shortType(), element.getSimpleName(), defaultVal, uType.mainType()));
" private %s %s%s;\n"
.formatted(uType.shortType(), element.getSimpleName(), defaultVal));
}

return builder.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ String template(
{1}

/** Builder class for '{'@link {2}'}' */
@Generated("avaje-record-builder")
public class {2}Builder '{'
{3}
private {2}Builder() '{'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.avaje.recordbuilder;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Marks source code that has been generated.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Generated {

/**
* The name of the generator used to generate this source.
*/
String value() default "";
}