Skip to content

Commit

Permalink
Start adding missing JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalbritter committed Dec 19, 2024
1 parent e645e5c commit d032e88
Show file tree
Hide file tree
Showing 41 changed files with 643 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public class MavenRepository {

private final boolean snapshotsEnabled;

/**
* Creates a new instance.
* @param builder the builder to use
*/
protected MavenRepository(Builder builder) {
this.id = builder.id;
this.name = builder.name;
Expand Down Expand Up @@ -123,6 +127,9 @@ public int hashCode() {
return Objects.hash(this.id, this.name, this.url, this.releasesEnabled, this.snapshotsEnabled);
}

/**
* Builder for {@link MavenRepository}.
*/
public static class Builder {

private String id;
Expand All @@ -135,6 +142,11 @@ public static class Builder {

private boolean snapshotsEnabled;

/**
* Creates a new instance.
* @param id the id
* @param url the url
*/
public Builder(String id, String url) {
this.id = id;
this.name = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public Set<String> getImportedTypes() {
}

/**
* A builder for {@link GradleExtension}.
* Builder for {@link GradleExtension}.
*/
public static class Builder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public Map<String, GradleTask> getNested() {
}

/**
* A builder for {@link GradleTask}.
* Builder for {@link GradleTask}.
*/
public static class Builder {

Expand All @@ -111,6 +111,11 @@ public static class Builder {

private final Map<String, Builder> nested = new LinkedHashMap<>();

/**
* Creates a new instance.
* @param name the name of the task
* @param type the type of the task
*/
protected Builder(String name, String type) {
this.name = name;
this.type = type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ protected void writeConfigurations(IndentingWriter writer, GradleConfigurationCo
writer.println("");
}

/**
* Writes the given configuration.
* @param writer the writer to write to
* @param configuration the configuration to write
*/
protected void writeConfiguration(IndentingWriter writer, GradleConfiguration configuration) {
writer.println(configuration.getName() + " {");
writer.indented(() -> writer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public class Invocation {

private final List<String> arguments;

/**
* Creates a new instance.
* @param target the target
* @param arguments the arguments
*/
public Invocation(String target, List<String> arguments) {
this.target = target;
this.arguments = List.copyOf(arguments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,18 @@ public class MavenBuild extends Build {

private final MavenProfileContainer profiles;

/**
* Creates a new instance.
* @param buildItemResolver the build item resolver
*/
public MavenBuild(BuildItemResolver buildItemResolver) {
super(buildItemResolver);
this.profiles = new MavenProfileContainer(determineBuildItemResolver(buildItemResolver));
}

/**
* Creates a new instance.
*/
public MavenBuild() {
this(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public class MavenBuildSettings extends BuildSettings {

private final boolean addOverrideIfEmpty;

/**
* Creates a new instance.
* @param builder the builder to use
*/
protected MavenBuildSettings(Builder builder) {
super(builder);
this.parent = builder.parent;
Expand Down Expand Up @@ -216,6 +220,9 @@ public static class Builder extends BuildSettings.Builder<Builder> {

private boolean addOverrideIfEmpty;

/**
* Creates a new instance.
*/
public Builder() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@
*/
public class MavenDependency extends Dependency {

/**
* Whether this dependency is optional.
*/
protected final boolean optional;

/**
* Creates a new instance.
* @param builder the builder to use
*/
protected MavenDependency(Builder builder) {
super(builder);
this.optional = builder.optional;
Expand Down Expand Up @@ -69,6 +76,11 @@ public static class Builder extends Dependency.Builder<Builder> {

private boolean optional;

/**
* Creates a new instance.
* @param groupId the group id
* @param artifactId the artifact id
*/
protected Builder(String groupId, String artifactId) {
super(groupId, artifactId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ public Builder property(String key, String value) {
return this;
}

/**
* Builds the developer.
* @return the developer
*/
public MavenDeveloper build() {
return new MavenDeveloper(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public class MavenDistributionManagement {
this.relocation = builder.relocation.build();
}

/**
* Returns whether this instance is empty.
* @return whether this instance is empty
*/
public boolean isEmpty() {
return this.downloadUrl == null && this.repository.isEmpty() && this.snapshotRepository.isEmpty()
&& this.site.isEmpty() && this.relocation.isEmpty();
Expand Down Expand Up @@ -92,17 +96,20 @@ public Relocation getRelocation() {
return this.relocation;
}

/**
* Builder for {@link MavenDistributionManagement}.
*/
public static class Builder {

private String downloadUrl;

private DeploymentRepository.Builder repository = new DeploymentRepository.Builder();
private final DeploymentRepository.Builder repository = new DeploymentRepository.Builder();

private DeploymentRepository.Builder snapshotRepository = new DeploymentRepository.Builder();
private final DeploymentRepository.Builder snapshotRepository = new DeploymentRepository.Builder();

private Site.Builder site = new Site.Builder();
private final Site.Builder site = new Site.Builder();

private Relocation.Builder relocation = new Relocation.Builder();
private final Relocation.Builder relocation = new Relocation.Builder();

/**
* Specify the URL where this project can be downloaded from.
Expand Down Expand Up @@ -188,6 +195,10 @@ public static class DeploymentRepository {
this.uniqueVersion = builder.uniqueVersion;
}

/**
* Returns whether this instance is empty.
* @return whether this instance is empty
*/
public boolean isEmpty() {
return this.id == null && this.name == null && this.url == null && this.layout == null
&& this.uniqueVersion == null;
Expand Down Expand Up @@ -234,6 +245,9 @@ public Boolean getUniqueVersion() {
return this.uniqueVersion;
}

/**
* Builder for {@link DeploymentRepository}.
*/
public static class Builder {

private String id;
Expand Down Expand Up @@ -329,6 +343,10 @@ public static class Site {
this.url = builder.url;
}

/**
* Returns whether this instance is empty.
* @return whether this instance is empty
*/
public boolean isEmpty() {
return this.id == null && this.name == null && this.url == null;
}
Expand Down Expand Up @@ -357,6 +375,9 @@ public String getUrl() {
return this.url;
}

/**
* Builder for {@link Site}.
*/
public static class Builder {

private String id;
Expand Down Expand Up @@ -429,6 +450,10 @@ public static class Relocation {
this.message = builder.message;
}

/**
* Returns whether this instance is empty.
* @return whether this instance is empty
*/
public boolean isEmpty() {
return this.groupId == null && this.artifactId == null && this.version == null && this.message == null;
}
Expand Down Expand Up @@ -465,6 +490,9 @@ public String getMessage() {
return this.message;
}

/**
* Builder for {@link Relocation}.
*/
public static class Builder {

private String groupId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public class MavenExtension {

private final VersionReference version;

/**
* Creates a new instance.
* @param builder the builder to use
*/
protected MavenExtension(Builder builder) {
this.groupId = builder.groupId;
this.artifactId = builder.artifactId;
Expand Down Expand Up @@ -72,6 +76,9 @@ public VersionReference getVersionReference() {
return this.version;
}

/**
* Builder for {@link MavenExtension}.
*/
public static class Builder {

private final String groupId;
Expand All @@ -80,6 +87,11 @@ public static class Builder {

private VersionReference version;

/**
* Creates a new instance.
* @param groupId the group id
* @param artifactId the artifact id
*/
protected Builder(String groupId, String artifactId) {
this.groupId = groupId;
this.artifactId = artifactId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ public Builder comments(String comments) {
return this;
}

/**
* Builds the license.
* @return the license
*/
public MavenLicense build() {
return new MavenLicense(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public class MavenPlugin {

private final Configuration configuration;

/**
* Creates a new instance.
* @param builder the builder to use
*/
protected MavenPlugin(Builder builder) {
this.groupId = builder.groupId;
this.artifactId = builder.artifactId;
Expand Down Expand Up @@ -158,6 +162,11 @@ public static class Builder {

private ConfigurationBuilder configurationBuilder;

/**
* Creates a new instance.
* @param groupId the group id
* @param artifactId the artifact id
*/
protected Builder(String groupId, String artifactId) {
this.groupId = groupId;
this.artifactId = artifactId;
Expand Down Expand Up @@ -279,6 +288,10 @@ public static class ExecutionBuilder {

private ConfigurationBuilder configurationCustomization = null;

/**
* Creates a new instance.
* @param id the id
*/
public ExecutionBuilder(String id) {
this.id = id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public class MavenProfile {

private final MavenDistributionManagement.Builder distributionManagement = new MavenDistributionManagement.Builder();

/**
* Creates a new instance.
* @param id the id
* @param buildItemResolver the build item resolver
*/
protected MavenProfile(String id, BuildItemResolver buildItemResolver) {
this.id = id;
this.dependencies = new DependencyContainer(buildItemResolver::resolveDependency);
Expand Down Expand Up @@ -214,6 +219,9 @@ public static class SettingsBuilder {

private String finalName;

/**
* Creates a new instance.
*/
protected SettingsBuilder() {
}

Expand Down Expand Up @@ -241,6 +249,10 @@ public SettingsBuilder finalName(String finalName) {
return this;
}

/**
* Builds the settings.
* @return the settings
*/
public Settings build() {
return new Settings(this);
}
Expand All @@ -256,7 +268,11 @@ public static final class Settings {

private final String finalName;

protected Settings(SettingsBuilder builder) {
/**
* Creates a new instance.
* @param builder the builder to use
*/
private Settings(SettingsBuilder builder) {
this.defaultGoal = builder.defaultGoal;
this.finalName = builder.finalName;
}
Expand Down
Loading

0 comments on commit d032e88

Please sign in to comment.