Class ProgramType._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<ProgramType>
-
- net.morimekta.providence.model.ProgramType._Builder
-
- All Implemented Interfaces:
ProgramType_OrBuilder,net.morimekta.providence.PBuilder<ProgramType>,net.morimekta.providence.PMessageOrBuilder<ProgramType>,net.morimekta.providence.PValue<ProgramType>,net.morimekta.providence.serializer.binary.BinaryReader
- Enclosing class:
- ProgramType
public static class ProgramType._Builder extends net.morimekta.providence.PMessageBuilder<ProgramType> implements ProgramType_OrBuilder, net.morimekta.providence.serializer.binary.BinaryReader
<namespace>* <include>* <declataion>*
-
-
Constructor Summary
Constructors Constructor Description _Builder()Make a p_model.ProgramType builder instance._Builder(ProgramType base)Make a mutating builder off a base p_model.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.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>descriptor()booleanequals(java.lang.Object o)<T> Tget(int key)java.util.List<Declaration>getDecl()List of declarations in the program file.java.lang.StringgetDocumentation()Program documentation must come before the first statement of the header.java.util.Map<java.lang.String,java.lang.String>getIncludes()List of included thrift files.java.util.Map<java.lang.String,java.lang.String>getNamespaces()Map of language to laguage dependent namespace identifier.java.lang.StringgetProgramName()The program name, deducted from the .thrift IDL file name.booleanhas(int key)booleanhasDecl()Checks for presence of thedeclfield.booleanhasDocumentation()Checks for presence of thedocumentationfield.inthashCode()booleanhasIncludes()Checks for presence of theincludesfield.booleanhasNamespaces()Checks for presence of thenamespacesfield.booleanhasProgramName()Checks for presence of theprogram_namefield.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 explicit presence of thedeclfield.booleanisSetDocumentation()Checks for explicit presence of thedocumentationfield.booleanisSetIncludes()Checks for explicit presence of theincludesfield.booleanisSetNamespaces()Checks for explicit presence of thenamespacesfield.booleanisSetProgramName()Checks for explicit presence of theprogram_namefield.ProgramType._Buildermerge(ProgramType from)java.util.List<Declaration>mutableDecl()List of declarations in the program file.java.util.Map<java.lang.String,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)intnumDecl()List of declarations in the program file.intnumIncludes()List of included thrift files.intnumNamespaces()Map of language to laguage dependent namespace identifier.java.util.Optional<java.util.List<Declaration>>optionalDecl()List of declarations in the program file.java.util.Optional<java.lang.String>optionalDocumentation()Program documentation must come before the first statement of the header.java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>optionalIncludes()List of included thrift files.java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>optionalNamespaces()Map of language to laguage dependent namespace identifier.ProgramType._BuilderputInIncludes(java.lang.String key, java.lang.String value)Adds a mapping to theincludesmap.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.Map<java.lang.String,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()ProgramType._Buildervalidate()-
Methods inherited from class net.morimekta.providence.PMessageBuilder
addTo, clear, isModified, isSet, modifiedFields, mutator, presentFields, set
-
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a p_model.ProgramType builder instance.
-
_Builder
public _Builder(ProgramType base)
Make a mutating builder off a base p_model.ProgramType.- Parameters:
base- The base ProgramType
-
-
Method Detail
-
merge
@Nonnull public ProgramType._Builder merge(ProgramType from)
- Specified by:
mergein classnet.morimekta.providence.PMessageBuilder<ProgramType>
-
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 explicit presence of thedocumentationfield.- Returns:
- True if documentation has been set.
-
hasDocumentation
public boolean hasDocumentation()
Checks for presence of thedocumentationfield.- Specified by:
hasDocumentationin interfaceProgramType_OrBuilder- Returns:
- True if documentation is present.
-
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.- Specified by:
getDocumentationin interfaceProgramType_OrBuilder- Returns:
- The
documentationfield value
-
optionalDocumentation
@Nonnull public java.util.Optional<java.lang.String> optionalDocumentation()
Program documentation must come before the first statement of the header.- Specified by:
optionalDocumentationin interfaceProgramType_OrBuilder- Returns:
- Optional
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 explicit presence of theprogram_namefield.- Returns:
- True if program_name has been set.
-
hasProgramName
public boolean hasProgramName()
Checks for presence of theprogram_namefield.- Specified by:
hasProgramNamein interfaceProgramType_OrBuilder- Returns:
- True if program_name is present.
-
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.- Specified by:
getProgramNamein interfaceProgramType_OrBuilder- Returns:
- The
program_namefield value
-
setIncludes
@Nonnull public ProgramType._Builder setIncludes(java.util.Map<java.lang.String,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
-
putInIncludes
@Nonnull public ProgramType._Builder putInIncludes(java.lang.String key, java.lang.String value)
Adds a mapping to theincludesmap.List of included thrift files. Same as from the actual thrift file.
include "<program>.thrift"
- Parameters:
key- The inserted keyvalue- The inserted value- Returns:
- The builder
-
isSetIncludes
public boolean isSetIncludes()
Checks for explicit presence of theincludesfield.- Returns:
- True if includes has been set.
-
hasIncludes
public boolean hasIncludes()
Checks for presence of theincludesfield.- Specified by:
hasIncludesin interfaceProgramType_OrBuilder- Returns:
- True if includes is present.
-
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.Map<java.lang.String,java.lang.String> mutableIncludes()
List of included thrift files. Same as from the actual thrift file.include "<program>.thrift"
- Returns:
- The mutable
includescontainer
-
getIncludes
public java.util.Map<java.lang.String,java.lang.String> getIncludes()
List of included thrift files. Same as from the actual thrift file.include "<program>.thrift"
- Specified by:
getIncludesin interfaceProgramType_OrBuilder- Returns:
- The
includesfield value
-
optionalIncludes
@Nonnull public java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> optionalIncludes()
List of included thrift files. Same as from the actual thrift file.include "<program>.thrift"
- Specified by:
optionalIncludesin interfaceProgramType_OrBuilder- Returns:
- Optional
includesfield value
-
numIncludes
public int numIncludes()
List of included thrift files. Same as from the actual thrift file.include "<program>.thrift"
- Specified by:
numIncludesin interfaceProgramType_OrBuilder- Returns:
- Number of entries in
includes.
-
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 explicit presence of thenamespacesfield.- Returns:
- True if namespaces has been set.
-
hasNamespaces
public boolean hasNamespaces()
Checks for presence of thenamespacesfield.- Specified by:
hasNamespacesin interfaceProgramType_OrBuilder- Returns:
- True if namespaces is present.
-
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
-
getNamespaces
public java.util.Map<java.lang.String,java.lang.String> getNamespaces()
Map of language to laguage dependent namespace identifier.namespace <key> <value>
- Specified by:
getNamespacesin interfaceProgramType_OrBuilder- Returns:
- The
namespacesfield value
-
optionalNamespaces
@Nonnull public java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> optionalNamespaces()
Map of language to laguage dependent namespace identifier.namespace <key> <value>
- Specified by:
optionalNamespacesin interfaceProgramType_OrBuilder- Returns:
- Optional
namespacesfield value
-
numNamespaces
public int numNamespaces()
Map of language to laguage dependent namespace identifier.namespace <key> <value>
- Specified by:
numNamespacesin interfaceProgramType_OrBuilder- Returns:
- Number of entries in
namespaces.
-
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 explicit presence of thedeclfield.- Returns:
- True if decl has been set.
-
hasDecl
public boolean hasDecl()
Checks for presence of thedeclfield.- Specified by:
hasDeclin interfaceProgramType_OrBuilder- Returns:
- True if decl is present.
-
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
-
getDecl
public java.util.List<Declaration> getDecl()
List of declarations in the program file. Same order as in the thrift file.- Specified by:
getDeclin interfaceProgramType_OrBuilder- Returns:
- The
declfield value
-
optionalDecl
@Nonnull public java.util.Optional<java.util.List<Declaration>> optionalDecl()
List of declarations in the program file. Same order as in the thrift file.- Specified by:
optionalDeclin interfaceProgramType_OrBuilder- Returns:
- Optional
declfield value
-
numDecl
public int numDecl()
List of declarations in the program file. Same order as in the thrift file.- Specified by:
numDeclin interfaceProgramType_OrBuilder- Returns:
- Number of entries in
decl.
-
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>
-
set
@Nonnull public ProgramType._Builder set(int key, java.lang.Object value)
- Specified by:
setin classnet.morimekta.providence.PMessageBuilder<ProgramType>
-
isSet
public boolean isSet(int key)
- Specified by:
isSetin classnet.morimekta.providence.PMessageBuilder<ProgramType>
-
isModified
public boolean isModified(int key)
- Specified by:
isModifiedin classnet.morimekta.providence.PMessageBuilder<ProgramType>
-
get
public <T> T get(int key)
- Specified by:
getin interfacenet.morimekta.providence.PMessageOrBuilder<ProgramType>
-
has
public boolean has(int key)
- Specified by:
hasin interfacenet.morimekta.providence.PMessageOrBuilder<ProgramType>
-
addTo
@Nonnull public ProgramType._Builder addTo(int key, java.lang.Object value)
- Specified by:
addToin classnet.morimekta.providence.PMessageBuilder<ProgramType>
-
clear
@Nonnull public ProgramType._Builder clear(int key)
- Specified by:
clearin classnet.morimekta.providence.PMessageBuilder<ProgramType>
-
valid
public boolean valid()
- Specified by:
validin classnet.morimekta.providence.PMessageBuilder<ProgramType>
-
validate
public ProgramType._Builder validate()
- Specified by:
validatein classnet.morimekta.providence.PMessageBuilder<ProgramType>
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PStructDescriptor<ProgramType> descriptor()
- Specified by:
descriptorin interfacenet.morimekta.providence.PMessageOrBuilder<ProgramType>- Specified by:
descriptorin interfacenet.morimekta.providence.PValue<ProgramType>
-
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
@Nonnull public ProgramType build()
- Specified by:
buildin interfacenet.morimekta.providence.PBuilder<ProgramType>
-
-