Package net.morimekta.providence.model
Class ProgramMeta._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
- net.morimekta.providence.model.ProgramMeta._Builder
-
- All Implemented Interfaces:
net.morimekta.providence.PBuilder<ProgramMeta>,net.morimekta.providence.serializer.binary.BinaryReader
- Enclosing class:
- ProgramMeta
public static class ProgramMeta._Builder extends net.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field> implements net.morimekta.providence.serializer.binary.BinaryReader
A meta object describing a parsed program file. This may include the included programs as their own meta file. The lines of the original program .thrift file is also included.
-
-
Constructor Summary
Constructors Constructor Description _Builder()Make a pmodel.ProgramMeta builder instance._Builder(ProgramMeta base)Make a mutating builder off a base pmodel.ProgramMeta.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProgramMeta._BuilderaddTo(int key, java.lang.Object value)ProgramMeta._BuilderaddToFileLines(java.lang.String... values)Adds entries to thefile_lineslist.ProgramMetabuild()ProgramMeta._Builderclear(int key)ProgramMeta._BuilderclearFileLines()Clear thefile_linesfield.ProgramMeta._BuilderclearFilePath()Clear thefile_pathfield.ProgramMeta._BuilderclearIncludes()Clear theincludesfield.ProgramMeta._BuilderclearProgram()Clear theprogramfield.net.morimekta.providence.descriptor.PStructDescriptor<ProgramMeta,ProgramMeta._Field>descriptor()booleanequals(java.lang.Object o)java.lang.StringgetFilePath()Full absolute path to the file.ProgramTypegetProgram()The program type definitioninthashCode()booleanisModified(int key)booleanisModifiedFileLines()Checks if thefile_linesfield has been modified since the builder was created.booleanisModifiedFilePath()Checks if thefile_pathfield has been modified since the builder was created.booleanisModifiedIncludes()Checks if theincludesfield has been modified since the builder was created.booleanisModifiedProgram()Checks if theprogramfield has been modified since the builder was created.booleanisSet(int key)booleanisSetFileLines()Checks for presence of thefile_linesfield.booleanisSetFilePath()Checks for presence of thefile_pathfield.booleanisSetIncludes()Checks for presence of theincludesfield.booleanisSetProgram()Checks for presence of theprogramfield.ProgramMeta._Buildermerge(ProgramMeta from)java.util.List<java.lang.String>mutableFileLines()The lines of the program filejava.util.Map<java.lang.String,ProgramMeta>mutableIncludes()Map of program name to meta of included programsProgramType._BuildermutableProgram()Get the builder for the containedprogrammessage field.net.morimekta.providence.PMessageBuildermutator(int key)ProgramMeta._BuilderputInIncludes(java.lang.String key, ProgramMeta value)Adds a mapping to theincludesmap.voidreadBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)ProgramMeta._Builderset(int key, java.lang.Object value)ProgramMeta._BuildersetFileLines(java.util.Collection<java.lang.String> value)Set thefile_linesfield value.ProgramMeta._BuildersetFilePath(java.lang.String value)Set thefile_pathfield value.ProgramMeta._BuildersetIncludes(java.util.Map<java.lang.String,ProgramMeta> value)Set theincludesfield value.ProgramMeta._BuildersetProgram(ProgramType value)Set theprogramfield value.ProgramMeta._BuildersetProgram(ProgramType._Builder builder)Set theprogramfield value.booleanvalid()voidvalidate()
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a pmodel.ProgramMeta builder instance.
-
_Builder
public _Builder(ProgramMeta base)
Make a mutating builder off a base pmodel.ProgramMeta.- Parameters:
base- The base ProgramMeta
-
-
Method Detail
-
merge
@Nonnull public ProgramMeta._Builder merge(ProgramMeta from)
- Specified by:
mergein classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
setFilePath
@Nonnull public ProgramMeta._Builder setFilePath(java.lang.String value)
Set thefile_pathfield value.Full absolute path to the file.
- Parameters:
value- The new value- Returns:
- The builder
-
isSetFilePath
public boolean isSetFilePath()
Checks for presence of thefile_pathfield.- Returns:
- True if file_path has been set.
-
isModifiedFilePath
public boolean isModifiedFilePath()
Checks if thefile_pathfield has been modified since the builder was created.- Returns:
- True if file_path has been modified.
-
clearFilePath
@Nonnull public ProgramMeta._Builder clearFilePath()
Clear thefile_pathfield.- Returns:
- The builder
-
getFilePath
public java.lang.String getFilePath()
Full absolute path to the file.- Returns:
- The
file_pathfield value
-
setFileLines
@Nonnull public ProgramMeta._Builder setFileLines(java.util.Collection<java.lang.String> value)
Set thefile_linesfield value.The lines of the program file
- Parameters:
value- The new value- Returns:
- The builder
-
addToFileLines
@Nonnull public ProgramMeta._Builder addToFileLines(java.lang.String... values)
Adds entries to thefile_lineslist.The lines of the program file
- Parameters:
values- The added value- Returns:
- The builder
-
isSetFileLines
public boolean isSetFileLines()
Checks for presence of thefile_linesfield.- Returns:
- True if file_lines has been set.
-
isModifiedFileLines
public boolean isModifiedFileLines()
Checks if thefile_linesfield has been modified since the builder was created.- Returns:
- True if file_lines has been modified.
-
clearFileLines
@Nonnull public ProgramMeta._Builder clearFileLines()
Clear thefile_linesfield.- Returns:
- The builder
-
mutableFileLines
public java.util.List<java.lang.String> mutableFileLines()
The lines of the program file- Returns:
- The mutable
file_linescontainer
-
setProgram
@Nonnull public ProgramMeta._Builder setProgram(ProgramType value)
Set theprogramfield value.The program type definition
- Parameters:
value- The new value- Returns:
- The builder
-
setProgram
@Nonnull public ProgramMeta._Builder setProgram(ProgramType._Builder builder)
Set theprogramfield value.The program type definition
- Parameters:
builder- builder for the new value- Returns:
- The builder
-
isSetProgram
public boolean isSetProgram()
Checks for presence of theprogramfield.- Returns:
- True if program has been set.
-
isModifiedProgram
public boolean isModifiedProgram()
Checks if theprogramfield has been modified since the builder was created.- Returns:
- True if program has been modified.
-
clearProgram
@Nonnull public ProgramMeta._Builder clearProgram()
Clear theprogramfield.- Returns:
- The builder
-
mutableProgram
@Nonnull public ProgramType._Builder mutableProgram()
Get the builder for the containedprogrammessage field.The program type definition
- Returns:
- The field message builder
-
getProgram
public ProgramType getProgram()
The program type definition- Returns:
- The field value
-
setIncludes
@Nonnull public ProgramMeta._Builder setIncludes(java.util.Map<java.lang.String,ProgramMeta> value)
Set theincludesfield value.Map of program name to meta of included programs
- Parameters:
value- The new value- Returns:
- The builder
-
putInIncludes
@Nonnull public ProgramMeta._Builder putInIncludes(java.lang.String key, ProgramMeta value)
Adds a mapping to theincludesmap.Map of program name to meta of included programs
- Parameters:
key- The inserted keyvalue- The inserted value- Returns:
- The builder
-
isSetIncludes
public boolean isSetIncludes()
Checks for presence of theincludesfield.- Returns:
- True if includes has been set.
-
isModifiedIncludes
public boolean isModifiedIncludes()
Checks if theincludesfield has been modified since the builder was created.- Returns:
- True if includes has been modified.
-
clearIncludes
@Nonnull public ProgramMeta._Builder clearIncludes()
Clear theincludesfield.- Returns:
- The builder
-
mutableIncludes
public java.util.Map<java.lang.String,ProgramMeta> mutableIncludes()
Map of program name to meta of included programs- Returns:
- The mutable
includescontainer
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
mutator
public net.morimekta.providence.PMessageBuilder mutator(int key)
- Specified by:
mutatorin classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
set
@Nonnull public ProgramMeta._Builder set(int key, java.lang.Object value)
- Specified by:
setin classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
isSet
public boolean isSet(int key)
- Specified by:
isSetin classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
isModified
public boolean isModified(int key)
- Specified by:
isModifiedin classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
addTo
@Nonnull public ProgramMeta._Builder addTo(int key, java.lang.Object value)
- Specified by:
addToin classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
clear
@Nonnull public ProgramMeta._Builder clear(int key)
- Specified by:
clearin classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
valid
public boolean valid()
- Specified by:
validin classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
validate
public void validate()
- Specified by:
validatein classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PStructDescriptor<ProgramMeta,ProgramMeta._Field> descriptor()
- Specified by:
descriptorin classnet.morimekta.providence.PMessageBuilder<ProgramMeta,ProgramMeta._Field>
-
readBinary
public void readBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict) throws java.io.IOException- Specified by:
readBinaryin interfacenet.morimekta.providence.serializer.binary.BinaryReader- Throws:
java.io.IOException
-
build
public ProgramMeta build()
- Specified by:
buildin interfacenet.morimekta.providence.PBuilder<ProgramMeta>
-
-