Class CodeGeneratorOptions
- java.lang.Object
-
- com.cosium.openapi.annotation_processor.code.CodeGeneratorOptions
-
- All Implemented Interfaces:
ICodeGeneratorOptions
@ParametersAreNonnullByDefault @Immutable public final class CodeGeneratorOptions extends Object implements ICodeGeneratorOptions
Created on 12/07/17.- Author:
- Reda.Housni-Alaoui
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCodeGeneratorOptions.BuilderBuilds instances of typeCodeGeneratorOptions.static interfaceCodeGeneratorOptions.BuildFinalstatic interfaceCodeGeneratorOptions.OneGenerationFolderPerLanguageBuildStage
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CodeGeneratorOptions.OneGenerationFolderPerLanguageBuildStagebuilder()Creates a builder forCodeGeneratorOptions.static CodeGeneratorOptionscopyOf(ICodeGeneratorOptions instance)Creates an immutable copy of aICodeGeneratorOptionsvalue.booleanequals(Object another)This instance is equal to all instances ofCodeGeneratorOptionsthat have equal attribute values.inthashCode()Computes a hash code from attributes:oneGenerationFolderPerLanguage,languages.com.google.common.collect.ImmutableList<String>languages()booleanoneGenerationFolderPerLanguage()StringtoString()Prints the immutable valueCodeGeneratorOptionswith attribute values.CodeGeneratorOptionswithLanguages(Iterable<String> elements)Copy the current immutable object with elements that replace the content oflanguages.CodeGeneratorOptionswithLanguages(String... elements)Copy the current immutable object with elements that replace the content oflanguages.CodeGeneratorOptionswithOneGenerationFolderPerLanguage(boolean value)Copy the current immutable object by setting a value for theoneGenerationFolderPerLanguageattribute.
-
-
-
Method Detail
-
oneGenerationFolderPerLanguage
public boolean oneGenerationFolderPerLanguage()
- Specified by:
oneGenerationFolderPerLanguagein interfaceICodeGeneratorOptions- Returns:
- True if each language code should be written in a separate folder named as the language
-
languages
public com.google.common.collect.ImmutableList<String> languages()
- Specified by:
languagesin interfaceICodeGeneratorOptions- Returns:
- Languages for which generation should occur
-
withOneGenerationFolderPerLanguage
public final CodeGeneratorOptions withOneGenerationFolderPerLanguage(boolean value)
Copy the current immutable object by setting a value for theoneGenerationFolderPerLanguageattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for oneGenerationFolderPerLanguage- Returns:
- A modified copy of the
thisobject
-
withLanguages
public final CodeGeneratorOptions withLanguages(String... elements)
Copy the current immutable object with elements that replace the content oflanguages.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withLanguages
public final CodeGeneratorOptions withLanguages(Iterable<String> elements)
Copy the current immutable object with elements that replace the content oflanguages. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of languages elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofCodeGeneratorOptionsthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:oneGenerationFolderPerLanguage,languages.
-
toString
public String toString()
Prints the immutable valueCodeGeneratorOptionswith attribute values.
-
copyOf
public static CodeGeneratorOptions copyOf(ICodeGeneratorOptions instance)
Creates an immutable copy of aICodeGeneratorOptionsvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable CodeGeneratorOptions instance
-
builder
public static CodeGeneratorOptions.OneGenerationFolderPerLanguageBuildStage builder()
Creates a builder forCodeGeneratorOptions.- Returns:
- A new CodeGeneratorOptions builder
-
-