Package net.morimekta.providence.model
Class ProgramType
- java.lang.Object
-
- net.morimekta.providence.model.ProgramType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ProgramType>
,ProgramType_OrBuilder
,PMessage<ProgramType>
,PMessageOrBuilder<ProgramType>
,PValue<ProgramType>
,BinaryWriter
,net.morimekta.util.Stringable
@Generated(value="net.morimekta.providence:providence-generator-java", comments="java:serializable") @Immutable public class ProgramType extends java.lang.Object implements ProgramType_OrBuilder, PMessage<ProgramType>, java.lang.Comparable<ProgramType>, java.io.Serializable, BinaryWriter
<namespace>* <include>* <declataion>*- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProgramType._Builder
<namespace>* <include>* <declataion>*static class
ProgramType._Field
-
Field Summary
Fields Modifier and Type Field Description static PStructDescriptor<ProgramType>
kDescriptor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString()
Pure string representation of content.static ProgramType._Builder
builder()
Make ap_model.ProgramType
builder.int
compareTo(ProgramType other)
PStructDescriptor<ProgramType>
descriptor()
boolean
equals(java.lang.Object o)
<T> T
get(int key)
java.util.List<Declaration>
getDecl()
List of declarations in the program file.java.lang.String
getDocumentation()
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.String
getProgramName()
The program name, deducted from the .thrift IDL file name.boolean
has(int key)
boolean
hasDecl()
boolean
hasDocumentation()
int
hashCode()
boolean
hasIncludes()
boolean
hasNamespaces()
boolean
hasProgramName()
ProgramType._Builder
mutate()
Get a builder that extends the current object.int
numDecl()
int
numIncludes()
int
numNamespaces()
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.static PStructDescriptorProvider<ProgramType>
provider()
java.lang.String
toString()
int
writeBinary(net.morimekta.util.io.BigEndianBinaryWriter writer)
Write the current message to the binary writer.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.PMessageOrBuilder
toBuilder, toMessage
-
-
-
-
Field Detail
-
kDescriptor
public static final PStructDescriptor<ProgramType> kDescriptor
-
-
Method Detail
-
hasDocumentation
public boolean hasDocumentation()
- Specified by:
hasDocumentation
in interfaceProgramType_OrBuilder
- Returns:
- If documentation is present.
-
getDocumentation
public java.lang.String getDocumentation()
Program documentation must come before the first statement of the header.- Specified by:
getDocumentation
in interfaceProgramType_OrBuilder
- Returns:
- The
documentation
value
-
optionalDocumentation
@Nonnull public java.util.Optional<java.lang.String> optionalDocumentation()
Program documentation must come before the first statement of the header.- Specified by:
optionalDocumentation
in interfaceProgramType_OrBuilder
- Returns:
- Optional of the
documentation
field value.
-
hasProgramName
public boolean hasProgramName()
- Specified by:
hasProgramName
in interfaceProgramType_OrBuilder
- Returns:
- If program_name is present.
-
getProgramName
@Nonnull public java.lang.String getProgramName()
The program name, deducted from the .thrift IDL file name.- Specified by:
getProgramName
in interfaceProgramType_OrBuilder
- Returns:
- The
program_name
value
-
numIncludes
public int numIncludes()
- Specified by:
numIncludes
in interfaceProgramType_OrBuilder
- Returns:
- Number of entries in includes.
-
hasIncludes
public boolean hasIncludes()
- Specified by:
hasIncludes
in interfaceProgramType_OrBuilder
- Returns:
- If includes is present.
-
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:
getIncludes
in interfaceProgramType_OrBuilder
- Returns:
- The
includes
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:
optionalIncludes
in interfaceProgramType_OrBuilder
- Returns:
- Optional of the
includes
field value.
-
numNamespaces
public int numNamespaces()
- Specified by:
numNamespaces
in interfaceProgramType_OrBuilder
- Returns:
- Number of entries in namespaces.
-
hasNamespaces
public boolean hasNamespaces()
- Specified by:
hasNamespaces
in interfaceProgramType_OrBuilder
- Returns:
- If namespaces is present.
-
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:
getNamespaces
in interfaceProgramType_OrBuilder
- Returns:
- The
namespaces
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:
optionalNamespaces
in interfaceProgramType_OrBuilder
- Returns:
- Optional of the
namespaces
field value.
-
numDecl
public int numDecl()
- Specified by:
numDecl
in interfaceProgramType_OrBuilder
- Returns:
- Number of entries in decl.
-
hasDecl
public boolean hasDecl()
- Specified by:
hasDecl
in interfaceProgramType_OrBuilder
- Returns:
- If decl is present.
-
getDecl
public java.util.List<Declaration> getDecl()
List of declarations in the program file. Same order as in the thrift file.- Specified by:
getDecl
in interfaceProgramType_OrBuilder
- Returns:
- The
decl
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:
optionalDecl
in interfaceProgramType_OrBuilder
- Returns:
- Optional of the
decl
field value.
-
has
public boolean has(int key)
- Specified by:
has
in interfacePMessageOrBuilder<ProgramType>
- Parameters:
key
- The key of the field.- Returns:
- Whether the field is present.
-
get
public <T> T get(int key)
- Specified by:
get
in interfacePMessageOrBuilder<ProgramType>
- Type Parameters:
T
- The return type.- Parameters:
key
- The key of the field.- Returns:
- The value of the field.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
asString
@Nonnull public java.lang.String asString()
Description copied from interface:PMessage
Pure string representation of content. Does not contain type info.- Specified by:
asString
in interfacePMessage<ProgramType>
- Specified by:
asString
in interfacenet.morimekta.util.Stringable
- Returns:
- String representation.
-
compareTo
public int compareTo(ProgramType other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ProgramType>
-
writeBinary
public int writeBinary(net.morimekta.util.io.BigEndianBinaryWriter writer) throws java.io.IOException
Description copied from interface:BinaryWriter
Write the current message to the binary writer. NOTE: This method is not intended to be used directly. Instead use theBinarySerializer.serialize(OutputStream, PMessageOrBuilder)
call.- Specified by:
writeBinary
in interfaceBinaryWriter
- Parameters:
writer
- The binary writer to write to.- Returns:
- The number of bytes written.
- Throws:
java.io.IOException
- If it failed to write the message for any reason.
-
mutate
@Nonnull public ProgramType._Builder mutate()
Description copied from interface:PMessage
Get a builder that extends the current object.- Specified by:
mutate
in interfacePMessage<ProgramType>
- Returns:
- The builder instance.
-
provider
@Nonnull public static PStructDescriptorProvider<ProgramType> provider()
-
descriptor
@Nonnull public PStructDescriptor<ProgramType> descriptor()
- Specified by:
descriptor
in interfacePMessageOrBuilder<ProgramType>
- Specified by:
descriptor
in interfacePValue<ProgramType>
-
builder
public static ProgramType._Builder builder()
Make ap_model.ProgramType
builder.- Returns:
- The builder instance.
-
-