Class CodeGeneratorUtils


  • public final class CodeGeneratorUtils
    extends java.lang.Object
    Utilities shared across Java dnd Kotlin code generators.
    • Method Detail

      • isRepresentableAsEnum

        public static boolean isRepresentableAsEnum​(PType type,
                                                    @Nullable java.util.Set<java.lang.String> collector)
      • isRepresentableAsString

        public static boolean isRepresentableAsString​(PType type)
      • toEnumConstantName

        public static @Nullable java.lang.String toEnumConstantName​(java.lang.String pklStringLiteral)
        Converts the given Pkl string literal to an idiomatic enum constant name. Returns null if and only if the string literal could not be converted.