Package net.morimekta.providence.model
Class ProgramMeta
- java.lang.Object
-
- net.morimekta.providence.model.ProgramMeta
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ProgramMeta>
,ProgramMeta_OrBuilder
,PMessage<ProgramMeta>
,PMessageOrBuilder<ProgramMeta>
,PValue<ProgramMeta>
,BinaryWriter
,net.morimekta.util.Stringable
@Generated(value="net.morimekta.providence:providence-generator-java", comments="java:serializable") @Immutable public class ProgramMeta extends java.lang.Object implements ProgramMeta_OrBuilder, PMessage<ProgramMeta>, java.lang.Comparable<ProgramMeta>, java.io.Serializable, BinaryWriter
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.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProgramMeta._Builder
A meta object describing a parsed program file.static class
ProgramMeta._Field
-
Field Summary
Fields Modifier and Type Field Description static PStructDescriptor<ProgramMeta>
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 ProgramMeta._Builder
builder()
Make ap_model.ProgramMeta
builder.int
compareTo(ProgramMeta other)
PStructDescriptor<ProgramMeta>
descriptor()
boolean
equals(java.lang.Object o)
<T> T
get(int key)
java.util.List<java.lang.String>
getFileLines()
The lines of the program filejava.lang.String
getFilePath()
Full absolute path to the file.java.util.Map<java.lang.String,ProgramMeta>
getIncludes()
Map of program name to meta of included programsProgramType
getProgram()
The program type definitionboolean
has(int key)
boolean
hasFileLines()
boolean
hasFilePath()
int
hashCode()
boolean
hasIncludes()
boolean
hasProgram()
ProgramMeta._Builder
mutate()
Get a builder that extends the current object.int
numFileLines()
int
numIncludes()
java.util.Optional<java.util.List<java.lang.String>>
optionalFileLines()
The lines of the program filejava.util.Optional<java.lang.String>
optionalFilePath()
Full absolute path to the file.java.util.Optional<java.util.Map<java.lang.String,ProgramMeta>>
optionalIncludes()
Map of program name to meta of included programsjava.util.Optional<ProgramType>
optionalProgram()
The program type definitionstatic PStructDescriptorProvider<ProgramMeta>
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<ProgramMeta> kDescriptor
-
-
Method Detail
-
hasFilePath
public boolean hasFilePath()
- Specified by:
hasFilePath
in interfaceProgramMeta_OrBuilder
- Returns:
- If file_path is present.
-
getFilePath
public java.lang.String getFilePath()
Full absolute path to the file.- Specified by:
getFilePath
in interfaceProgramMeta_OrBuilder
- Returns:
- The
file_path
value
-
optionalFilePath
@Nonnull public java.util.Optional<java.lang.String> optionalFilePath()
Full absolute path to the file.- Specified by:
optionalFilePath
in interfaceProgramMeta_OrBuilder
- Returns:
- Optional of the
file_path
field value.
-
numFileLines
public int numFileLines()
- Specified by:
numFileLines
in interfaceProgramMeta_OrBuilder
- Returns:
- Number of entries in file_lines.
-
hasFileLines
public boolean hasFileLines()
- Specified by:
hasFileLines
in interfaceProgramMeta_OrBuilder
- Returns:
- If file_lines is present.
-
getFileLines
public java.util.List<java.lang.String> getFileLines()
The lines of the program file- Specified by:
getFileLines
in interfaceProgramMeta_OrBuilder
- Returns:
- The
file_lines
value
-
optionalFileLines
@Nonnull public java.util.Optional<java.util.List<java.lang.String>> optionalFileLines()
The lines of the program file- Specified by:
optionalFileLines
in interfaceProgramMeta_OrBuilder
- Returns:
- Optional of the
file_lines
field value.
-
hasProgram
public boolean hasProgram()
- Specified by:
hasProgram
in interfaceProgramMeta_OrBuilder
- Returns:
- If program is present.
-
getProgram
public ProgramType getProgram()
The program type definition- Specified by:
getProgram
in interfaceProgramMeta_OrBuilder
- Returns:
- The
program
value
-
optionalProgram
@Nonnull public java.util.Optional<ProgramType> optionalProgram()
The program type definition- Specified by:
optionalProgram
in interfaceProgramMeta_OrBuilder
- Returns:
- Optional of the
program
field value.
-
numIncludes
public int numIncludes()
- Specified by:
numIncludes
in interfaceProgramMeta_OrBuilder
- Returns:
- Number of entries in includes.
-
hasIncludes
public boolean hasIncludes()
- Specified by:
hasIncludes
in interfaceProgramMeta_OrBuilder
- Returns:
- If includes is present.
-
getIncludes
public java.util.Map<java.lang.String,ProgramMeta> getIncludes()
Map of program name to meta of included programs- Specified by:
getIncludes
in interfaceProgramMeta_OrBuilder
- Returns:
- The
includes
value
-
optionalIncludes
@Nonnull public java.util.Optional<java.util.Map<java.lang.String,ProgramMeta>> optionalIncludes()
Map of program name to meta of included programs- Specified by:
optionalIncludes
in interfaceProgramMeta_OrBuilder
- Returns:
- Optional of the
includes
field value.
-
has
public boolean has(int key)
- Specified by:
has
in interfacePMessageOrBuilder<ProgramMeta>
- 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<ProgramMeta>
- 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<ProgramMeta>
- Specified by:
asString
in interfacenet.morimekta.util.Stringable
- Returns:
- String representation.
-
compareTo
public int compareTo(ProgramMeta other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ProgramMeta>
-
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 ProgramMeta._Builder mutate()
Description copied from interface:PMessage
Get a builder that extends the current object.- Specified by:
mutate
in interfacePMessage<ProgramMeta>
- Returns:
- The builder instance.
-
provider
@Nonnull public static PStructDescriptorProvider<ProgramMeta> provider()
-
descriptor
@Nonnull public PStructDescriptor<ProgramMeta> descriptor()
- Specified by:
descriptor
in interfacePMessageOrBuilder<ProgramMeta>
- Specified by:
descriptor
in interfacePValue<ProgramMeta>
-
builder
public static ProgramMeta._Builder builder()
Make ap_model.ProgramMeta
builder.- Returns:
- The builder instance.
-
-