Package io.github.cdklabs.projen
Class JsonFileOptions.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.JsonFileOptions.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<JsonFileOptions>
- Enclosing interface:
- JsonFileOptions
@Stability(Experimental) public static final class JsonFileOptions.Builder extends Object implements software.amazon.jsii.Builder<JsonFileOptions>
A builder forJsonFileOptions
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
allowComments
@Stability(Experimental) public JsonFileOptions.Builder allowComments(Boolean allowComments)
Sets the value ofJsonFileOptions.getAllowComments()- Parameters:
allowComments- Allow the use of comments in this file.- Returns:
this
-
newline
@Stability(Experimental) public JsonFileOptions.Builder newline(Boolean newline)
Sets the value ofJsonFileOptions.getNewline()- Parameters:
newline- Adds a newline at the end of the file.- Returns:
this
-
obj
@Stability(Experimental) public JsonFileOptions.Builder obj(Object obj)
Sets the value ofObjectFileOptions.getObj()- Parameters:
obj- The object that will be serialized. You can modify the object's contents before synthesis. Serialization of the object is similar to JSON.stringify with few enhancements:- values that are functions will be called during synthesis and the result will be serialized - this allow to have lazy values.
Setwill be converted to arrayMapwill be converted to a plain object ({ key: value, ... }})RegExpwithout flags will be converted to string representation of the source
- Returns:
this
-
omitEmpty
@Stability(Experimental) public JsonFileOptions.Builder omitEmpty(Boolean omitEmpty)
Sets the value ofObjectFileOptions.getOmitEmpty()- Parameters:
omitEmpty- Omits empty objects and arrays.- Returns:
this
-
committed
@Stability(Experimental) public JsonFileOptions.Builder committed(Boolean committed)
Sets the value ofFileBaseOptions.getCommitted()- Parameters:
committed- Indicates whether this file should be committed to git or ignored. By default, all generated files are committed and anti-tamper is used to protect against manual modifications.- Returns:
this
-
editGitignore
@Stability(Experimental) public JsonFileOptions.Builder editGitignore(Boolean editGitignore)
Sets the value ofFileBaseOptions.getEditGitignore()- Parameters:
editGitignore- Update the project's .gitignore file.- Returns:
this
-
executable
@Stability(Experimental) public JsonFileOptions.Builder executable(Boolean executable)
Sets the value ofFileBaseOptions.getExecutable()- Parameters:
executable- Whether the generated file should be marked as executable.- Returns:
this
-
marker
@Stability(Experimental) public JsonFileOptions.Builder marker(Boolean marker)
Sets the value ofFileBaseOptions.getMarker()- Parameters:
marker- Adds the projen marker to the file.- Returns:
this
-
readonly
@Stability(Experimental) public JsonFileOptions.Builder readonly(Boolean readonly)
Sets the value ofFileBaseOptions.getReadonly()- Parameters:
readonly- Whether the generated file should be readonly.- Returns:
this
-
build
@Stability(Experimental) public JsonFileOptions build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<JsonFileOptions>- Returns:
- a new instance of
JsonFileOptions - Throws:
NullPointerException- if any required attribute was not provided
-
-