Record Class FileSetWriter

java.lang.Object
java.lang.Record
com.hedera.pbj.compiler.impl.FileSetWriter

public record FileSetWriter(JavaFileWriter modelWriter, JavaFileWriter schemaWriter, JavaFileWriter codecWriter, JavaFileWriter jsonCodecWriter, JavaFileWriter testWriter, boolean generateTestClasses) extends Record
This is essentially a set of all the JavaFileWriter objects that are necessary to support the generation of a single top-level .proto model implementation in Java, such as a model writer, a codec writer, etc.
  • Constructor Details

    • FileSetWriter

      public FileSetWriter(JavaFileWriter modelWriter, JavaFileWriter schemaWriter, JavaFileWriter codecWriter, JavaFileWriter jsonCodecWriter, JavaFileWriter testWriter, boolean generateTestClasses)
      Creates an instance of a FileSetWriter record class.
      Parameters:
      modelWriter - the value for the modelWriter record component
      schemaWriter - the value for the schemaWriter record component
      codecWriter - the value for the codecWriter record component
      jsonCodecWriter - the value for the jsonCodecWriter record component
      testWriter - the value for the testWriter record component
      generateTestClasses - the value for the generateTestClasses record component
  • Method Details

    • create

      public static FileSetWriter create(File mainOutputDir, File testOutputDir, Protobuf3Parser.MessageDefContext msgDef, ContextualLookupHelper contextualLookupHelper, boolean generateTestClasses)
      A factory to create a FileSetWriter instance for a given MessageDefContext.
    • writeAllFiles

      public void writeAllFiles() throws IOException
      A utility method to write all the files at once.
      Throws:
      IOException
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • modelWriter

      public JavaFileWriter modelWriter()
      Returns the value of the modelWriter record component.
      Returns:
      the value of the modelWriter record component
    • schemaWriter

      public JavaFileWriter schemaWriter()
      Returns the value of the schemaWriter record component.
      Returns:
      the value of the schemaWriter record component
    • codecWriter

      public JavaFileWriter codecWriter()
      Returns the value of the codecWriter record component.
      Returns:
      the value of the codecWriter record component
    • jsonCodecWriter

      public JavaFileWriter jsonCodecWriter()
      Returns the value of the jsonCodecWriter record component.
      Returns:
      the value of the jsonCodecWriter record component
    • testWriter

      public JavaFileWriter testWriter()
      Returns the value of the testWriter record component.
      Returns:
      the value of the testWriter record component
    • generateTestClasses

      public boolean generateTestClasses()
      Returns the value of the generateTestClasses record component.
      Returns:
      the value of the generateTestClasses record component