Class CodecParseMethodGenerator

java.lang.Object
com.hedera.pbj.compiler.impl.generators.protobuf.CodecParseMethodGenerator

class CodecParseMethodGenerator extends Object
Code to generate the parse method for Codec classes.
  • Constructor Details

    • CodecParseMethodGenerator

      CodecParseMethodGenerator()
  • Method Details

    • generateUnsetOneOfConstants

      static String generateUnsetOneOfConstants(List<Field> fields)
      Because all UNSET OneOf values are the same and we use them often we create a static constant for them and just reuse it throughout codec code.
      Parameters:
      fields - the fields to generate for
      Returns:
      code for constants
    • generateParseMethod

      static String generateParseMethod(StringBuilder sbFunc, String modelClassName, String schemaClassName, List<Field> fields, boolean isCacheable)
    • generateCacheableSupport

      static String generateCacheableSupport(String modelClassName, List<Field> fields)
    • generateParseLoop

      static CodecParseMethodGenerator.ParseAndDefaultBody generateParseLoop(String caseStatements, @NonNull String prefix, @NonNull String schemaClassName)
    • readMethod

      static String readMethod(Field field)