io.github.cdklabs.projen.License Maven / Gradle / Ivy
Show all versions of projen Show documentation
package io.github.cdklabs.projen;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T17:03:54.811Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.projen.$Module.class, fqn = "projen.License")
public class License extends io.github.cdklabs.projen.FileBase {
protected License(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected License(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param project This parameter is required.
* @param options This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public License(final @org.jetbrains.annotations.NotNull io.github.cdklabs.projen.Project project, final @org.jetbrains.annotations.NotNull io.github.cdklabs.projen.LicenseOptions options) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(project, "project is required"), java.util.Objects.requireNonNull(options, "options is required") });
}
/**
* (experimental) Implemented by derived classes and returns the contents of the file to emit.
*
* @param _ This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
protected @org.jetbrains.annotations.Nullable java.lang.String synthesizeContent(final @org.jetbrains.annotations.NotNull io.github.cdklabs.projen.IResolver __) {
return software.amazon.jsii.Kernel.call(this, "synthesizeContent", software.amazon.jsii.NativeType.forClass(java.lang.String.class), new Object[] { java.util.Objects.requireNonNull(__, "__ is required") });
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.projen.License}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param project This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final io.github.cdklabs.projen.Project project) {
return new Builder(project);
}
private final io.github.cdklabs.projen.Project project;
private final io.github.cdklabs.projen.LicenseOptions.Builder options;
private Builder(final io.github.cdklabs.projen.Project project) {
this.project = project;
this.options = new io.github.cdklabs.projen.LicenseOptions.Builder();
}
/**
* (experimental) License type (SPDX).
*
* @return {@code this}
* @see https://github.com/projen/projen/tree/main/license-text for list of supported licenses
* @param spdx License type (SPDX). This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder spdx(final java.lang.String spdx) {
this.options.spdx(spdx);
return this;
}
/**
* (experimental) Copyright owner.
*
* If the license text has $copyright_owner, this option must be specified.
*
* Default: -
*
* @return {@code this}
* @param copyrightOwner Copyright owner. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder copyrightOwner(final java.lang.String copyrightOwner) {
this.options.copyrightOwner(copyrightOwner);
return this;
}
/**
* (experimental) Period of license (e.g. "1998-2023").
*
* The string $copyright_period
will be substituted with this string.
*
* Default: - current year (e.g. "2020")
*
* @return {@code this}
* @param copyrightPeriod Period of license (e.g. "1998-2023"). This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder copyrightPeriod(final java.lang.String copyrightPeriod) {
this.options.copyrightPeriod(copyrightPeriod);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.projen.License}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.projen.License build() {
return new io.github.cdklabs.projen.License(
this.project,
this.options.build()
);
}
}
}