Package io.github.astrapi69
Class GeneratorExtensions
- java.lang.Object
-
- io.github.astrapi69.GeneratorExtensions
-
public final class GeneratorExtensions extends java.lang.Object
The classGeneratorExtensions
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.String>
newConstantsFromStringList(java.util.List<java.lang.String> data, java.lang.String prefix, java.lang.String suffix, boolean withQuotation)
Creates a String list with the String constants from the given String list.static java.lang.String
newStaticArrayVariable(java.lang.String arrayName, java.util.List<java.lang.String> data)
Creates a String for a constant Stringarray to be inserted in java-file.
-
-
-
Method Detail
-
newConstantsFromStringList
public static java.util.List<java.lang.String> newConstantsFromStringList(java.util.List<java.lang.String> data, java.lang.String prefix, java.lang.String suffix, boolean withQuotation)
Creates a String list with the String constants from the given String list. For instance: List data = new ArrayList(); data.add("foo"); data.add("bar"); newConstantsFromStringList(data, false); Result from list:[ "public static final String FOO = "foo";", "public static final String BAR = "bar";"]- Parameters:
data
- The data from what to create the contant strings.prefix
- If the constant name needs a prefix.suffix
- If the constant name needs a suffix.withQuotation
- If the strings in the list have already quotation marks then true.- Returns:
- A list with constants strings.
-
newStaticArrayVariable
public static java.lang.String newStaticArrayVariable(java.lang.String arrayName, java.util.List<java.lang.String> data)
Creates a String for a constant Stringarray to be inserted in java-file. For instance: List data = new ArrayList(); data.add("foo"); data.add("bar"); newcreateStaticArrayVariable("test", data); Resultstring: "public static final String [] TEST = { "foo", "bar"};"- Parameters:
arrayName
- The name from the array.data
- The data what to insert in the generated array.- Returns:
- The result.
-
-