Package net.morimekta.providence.model
Class ProgramType._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field>
-
- net.morimekta.providence.model.ProgramType._Builder
-
- All Implemented Interfaces:
net.morimekta.providence.PBuilder<ProgramType>,net.morimekta.providence.serializer.binary.BinaryReader
- Enclosing class:
- ProgramType
public static class ProgramType._Builder extends net.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field> implements net.morimekta.providence.serializer.binary.BinaryReader
<namespace>* <include>* <declataion>*
-
-
Constructor Summary
Constructors Constructor Description _Builder()Make a pmodel.ProgramType builder instance._Builder(ProgramType base)Make a mutating builder off a base pmodel.ProgramType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProgramType._BuilderaddTo(int key, java.lang.Object value)ProgramType._BuilderaddToDecl(Declaration... values)Adds entries to thedecllist.ProgramType._BuilderaddToIncludes(java.lang.String... values)Adds entries to theincludeslist.ProgramTypebuild()ProgramType._Builderclear(int key)ProgramType._BuilderclearDecl()Clear thedeclfield.ProgramType._BuilderclearDocumentation()Clear thedocumentationfield.ProgramType._BuilderclearIncludes()Clear theincludesfield.ProgramType._BuilderclearNamespaces()Clear thenamespacesfield.ProgramType._BuilderclearProgramName()Clear theprogram_namefield.net.morimekta.providence.descriptor.PStructDescriptor<ProgramType,ProgramType._Field>descriptor()booleanequals(java.lang.Object o)java.lang.StringgetDocumentation()Program documentation must come before the first statement of the header.java.lang.StringgetProgramName()The program name, deducted from the .thrift IDL file name.inthashCode()booleanisModified(int key)booleanisModifiedDecl()Checks if thedeclfield has been modified since the builder was created.booleanisModifiedDocumentation()Checks if thedocumentationfield has been modified since the builder was created.booleanisModifiedIncludes()Checks if theincludesfield has been modified since the builder was created.booleanisModifiedNamespaces()Checks if thenamespacesfield has been modified since the builder was created.booleanisModifiedProgramName()Checks if theprogram_namefield has been modified since the builder was created.booleanisSet(int key)booleanisSetDecl()Checks for presence of thedeclfield.booleanisSetDocumentation()Checks for presence of thedocumentationfield.booleanisSetIncludes()Checks for presence of theincludesfield.booleanisSetNamespaces()Checks for presence of thenamespacesfield.booleanisSetProgramName()Checks for presence of theprogram_namefield.ProgramType._Buildermerge(ProgramType from)java.util.List<Declaration>mutableDecl()List of declarations in the program file.java.util.List<java.lang.String>mutableIncludes()List of included thrift files.java.util.Map<java.lang.String,java.lang.String>mutableNamespaces()Map of language to laguage dependent namespace identifier.net.morimekta.providence.PMessageBuildermutator(int key)ProgramType._BuilderputInNamespaces(java.lang.String key, java.lang.String value)Adds a mapping to thenamespacesmap.voidreadBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)ProgramType._Builderset(int key, java.lang.Object value)ProgramType._BuildersetDecl(java.util.Collection<Declaration> value)Set thedeclfield value.ProgramType._BuildersetDocumentation(java.lang.String value)Set thedocumentationfield value.ProgramType._BuildersetIncludes(java.util.Collection<java.lang.String> value)Set theincludesfield value.ProgramType._BuildersetNamespaces(java.util.Map<java.lang.String,java.lang.String> value)Set thenamespacesfield value.ProgramType._BuildersetProgramName(java.lang.String value)Set theprogram_namefield value.booleanvalid()voidvalidate()
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a pmodel.ProgramType builder instance.
-
_Builder
public _Builder(ProgramType base)
Make a mutating builder off a base pmodel.ProgramType.- Parameters:
base- The base ProgramType
-
-
Method Detail
-
merge
@Nonnull public ProgramType._Builder merge(ProgramType from)
- Specified by:
mergein classnet.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field>
-
setDocumentation
@Nonnull public ProgramType._Builder setDocumentation(java.lang.String value)
Set thedocumentationfield value.Program documentation must come before the first statement of the header.
- Parameters:
value- The new value- Returns:
- The builder
-
isSetDocumentation
public boolean isSetDocumentation()
Checks for presence of thedocumentationfield.- Returns:
- True if documentation has been set.
-
isModifiedDocumentation
public boolean isModifiedDocumentation()
Checks if thedocumentationfield has been modified since the builder was created.- Returns:
- True if documentation has been modified.
-
clearDocumentation
@Nonnull public ProgramType._Builder clearDocumentation()
Clear thedocumentationfield.- Returns:
- The builder
-
getDocumentation
public java.lang.String getDocumentation()
Program documentation must come before the first statement of the header.- Returns:
- The
documentationfield value
-
setProgramName
@Nonnull public ProgramType._Builder setProgramName(java.lang.String value)
Set theprogram_namefield value.The program name, deducted from the .thrift IDL file name.
- Parameters:
value- The new value- Returns:
- The builder
-
isSetProgramName
public boolean isSetProgramName()
Checks for presence of theprogram_namefield.- Returns:
- True if program_name has been set.
-
isModifiedProgramName
public boolean isModifiedProgramName()
Checks if theprogram_namefield has been modified since the builder was created.- Returns:
- True if program_name has been modified.
-
clearProgramName
@Nonnull public ProgramType._Builder clearProgramName()
Clear theprogram_namefield.- Returns:
- The builder
-
getProgramName
public java.lang.String getProgramName()
The program name, deducted from the .thrift IDL file name.- Returns:
- The
program_namefield value
-
setIncludes
@Nonnull public ProgramType._Builder setIncludes(java.util.Collection<java.lang.String> value)
Set theincludesfield value.List of included thrift files. Same as from the actual thrift file.
include "<program>.thrift"
- Parameters:
value- The new value- Returns:
- The builder
-
addToIncludes
@Nonnull public ProgramType._Builder addToIncludes(java.lang.String... values)
Adds entries to theincludeslist.List of included thrift files. Same as from the actual thrift file.
include "<program>.thrift"
- Parameters:
values- The added 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 ProgramType._Builder clearIncludes()
Clear theincludesfield.- Returns:
- The builder
-
mutableIncludes
public java.util.List<java.lang.String> mutableIncludes()
List of included thrift files. Same as from the actual thrift file.include "<program>.thrift"
- Returns:
- The mutable
includescontainer
-
setNamespaces
@Nonnull public ProgramType._Builder setNamespaces(java.util.Map<java.lang.String,java.lang.String> value)
Set thenamespacesfield value.Map of language to laguage dependent namespace identifier.
namespace <key> <value>
- Parameters:
value- The new value- Returns:
- The builder
-
putInNamespaces
@Nonnull public ProgramType._Builder putInNamespaces(java.lang.String key, java.lang.String value)
Adds a mapping to thenamespacesmap.Map of language to laguage dependent namespace identifier.
namespace <key> <value>
- Parameters:
key- The inserted keyvalue- The inserted value- Returns:
- The builder
-
isSetNamespaces
public boolean isSetNamespaces()
Checks for presence of thenamespacesfield.- Returns:
- True if namespaces has been set.
-
isModifiedNamespaces
public boolean isModifiedNamespaces()
Checks if thenamespacesfield has been modified since the builder was created.- Returns:
- True if namespaces has been modified.
-
clearNamespaces
@Nonnull public ProgramType._Builder clearNamespaces()
Clear thenamespacesfield.- Returns:
- The builder
-
mutableNamespaces
public java.util.Map<java.lang.String,java.lang.String> mutableNamespaces()
Map of language to laguage dependent namespace identifier.namespace <key> <value>
- Returns:
- The mutable
namespacescontainer
-
setDecl
@Nonnull public ProgramType._Builder setDecl(java.util.Collection<Declaration> value)
Set thedeclfield value.List of declarations in the program file. Same order as in the thrift file.
- Parameters:
value- The new value- Returns:
- The builder
-
addToDecl
@Nonnull public ProgramType._Builder addToDecl(Declaration... values)
Adds entries to thedecllist.List of declarations in the program file. Same order as in the thrift file.
- Parameters:
values- The added value- Returns:
- The builder
-
isSetDecl
public boolean isSetDecl()
Checks for presence of thedeclfield.- Returns:
- True if decl has been set.
-
isModifiedDecl
public boolean isModifiedDecl()
Checks if thedeclfield has been modified since the builder was created.- Returns:
- True if decl has been modified.
-
clearDecl
@Nonnull public ProgramType._Builder clearDecl()
Clear thedeclfield.- Returns:
- The builder
-
mutableDecl
public java.util.List<Declaration> mutableDecl()
List of declarations in the program file. Same order as in the thrift file.- Returns:
- The mutable
declcontainer
-
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<ProgramType,ProgramType._Field>
-
set
@Nonnull public ProgramType._Builder set(int key, java.lang.Object value)
- Specified by:
setin classnet.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field>
-
isSet
public boolean isSet(int key)
- Specified by:
isSetin classnet.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field>
-
isModified
public boolean isModified(int key)
- Specified by:
isModifiedin classnet.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field>
-
addTo
@Nonnull public ProgramType._Builder addTo(int key, java.lang.Object value)
- Specified by:
addToin classnet.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field>
-
clear
@Nonnull public ProgramType._Builder clear(int key)
- Specified by:
clearin classnet.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field>
-
valid
public boolean valid()
- Specified by:
validin classnet.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field>
-
validate
public void validate()
- Specified by:
validatein classnet.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._Field>
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PStructDescriptor<ProgramType,ProgramType._Field> descriptor()
- Specified by:
descriptorin classnet.morimekta.providence.PMessageBuilder<ProgramType,ProgramType._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 ProgramType build()
- Specified by:
buildin interfacenet.morimekta.providence.PBuilder<ProgramType>
-
-