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 Summary
ConstructorsConstructorDescriptionFileSetWriter(JavaFileWriter modelWriter, JavaFileWriter schemaWriter, JavaFileWriter codecWriter, JavaFileWriter jsonCodecWriter, JavaFileWriter testWriter, boolean generateTestClasses) Creates an instance of aFileSetWriterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecodecWriterrecord component.static FileSetWritercreate(File mainOutputDir, File testOutputDir, Protobuf3Parser.MessageDefContext msgDef, ContextualLookupHelper contextualLookupHelper, boolean generateTestClasses) A factory to create a FileSetWriter instance for a given MessageDefContext.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thegenerateTestClassesrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thejsonCodecWriterrecord component.Returns the value of themodelWriterrecord component.Returns the value of theschemaWriterrecord component.Returns the value of thetestWriterrecord component.final StringtoString()Returns a string representation of this record class.voidA utility method to write all the files at once.
-
Constructor Details
-
FileSetWriter
public FileSetWriter(JavaFileWriter modelWriter, JavaFileWriter schemaWriter, JavaFileWriter codecWriter, JavaFileWriter jsonCodecWriter, JavaFileWriter testWriter, boolean generateTestClasses) Creates an instance of aFileSetWriterrecord class.- Parameters:
modelWriter- the value for themodelWriterrecord componentschemaWriter- the value for theschemaWriterrecord componentcodecWriter- the value for thecodecWriterrecord componentjsonCodecWriter- the value for thejsonCodecWriterrecord componenttestWriter- the value for thetestWriterrecord componentgenerateTestClasses- the value for thegenerateTestClassesrecord 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
A utility method to write all the files at once.- Throws:
IOException
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
modelWriter
Returns the value of themodelWriterrecord component.- Returns:
- the value of the
modelWriterrecord component
-
schemaWriter
Returns the value of theschemaWriterrecord component.- Returns:
- the value of the
schemaWriterrecord component
-
codecWriter
Returns the value of thecodecWriterrecord component.- Returns:
- the value of the
codecWriterrecord component
-
jsonCodecWriter
Returns the value of thejsonCodecWriterrecord component.- Returns:
- the value of the
jsonCodecWriterrecord component
-
testWriter
Returns the value of thetestWriterrecord component.- Returns:
- the value of the
testWriterrecord component
-
generateTestClasses
public boolean generateTestClasses()Returns the value of thegenerateTestClassesrecord component.- Returns:
- the value of the
generateTestClassesrecord component
-