Package net.morimekta.providence.model
Class ConstType
- java.lang.Object
-
- net.morimekta.providence.model.ConstType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ConstType>
,PMessage<ConstType,ConstType._Field>
,PValue<ConstType>
,BinaryWriter
,net.morimekta.util.Stringable
@Generated("providence-maven-plugin") @Immutable public class ConstType extends java.lang.Object implements PMessage<ConstType,ConstType._Field>, java.lang.Comparable<ConstType>, java.io.Serializable, BinaryWriter
const <type> <name> = <value>- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConstType._Builder
const <type> <name> = <value>static class
ConstType._Field
-
Field Summary
Fields Modifier and Type Field Description static PStructDescriptor<ConstType,ConstType._Field>
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 ConstType._Builder
builder()
Make a providence_model.ConstType builder.int
compareTo(ConstType other)
PStructDescriptor<ConstType,ConstType._Field>
descriptor()
boolean
equals(java.lang.Object o)
<T> T
get(int key)
java.util.Map<java.lang.String,java.lang.String>
getAnnotations()
java.lang.String
getDocumentation()
java.lang.String
getName()
int
getStartLineNo()
Note the start of the const in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.int
getStartLinePos()
java.lang.String
getType()
java.lang.String
getValue()
boolean
has(int key)
boolean
hasAnnotations()
boolean
hasDocumentation()
int
hashCode()
boolean
hasName()
boolean
hasStartLineNo()
boolean
hasStartLinePos()
boolean
hasType()
boolean
hasValue()
ConstType._Builder
mutate()
Get a builder that extends the current object.int
numAnnotations()
java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>
optionalAnnotations()
java.util.Optional<java.lang.String>
optionalDocumentation()
java.util.OptionalInt
optionalStartLineNo()
Note the start of the const in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.java.util.OptionalInt
optionalStartLinePos()
static PStructDescriptorProvider<ConstType,ConstType._Field>
provider()
java.lang.String
toString()
int
writeBinary(net.morimekta.util.io.BigEndianBinaryWriter writer)
Write the current message to the binary writer.
-
-
-
Field Detail
-
kDescriptor
public static final PStructDescriptor<ConstType,ConstType._Field> kDescriptor
-
-
Method Detail
-
hasDocumentation
public boolean hasDocumentation()
-
getDocumentation
public java.lang.String getDocumentation()
- Returns:
- The field value
-
optionalDocumentation
@Nonnull public java.util.Optional<java.lang.String> optionalDocumentation()
- Returns:
- Optional field value
-
hasType
public boolean hasType()
-
getType
@Nonnull public java.lang.String getType()
- Returns:
- The field value
-
hasName
public boolean hasName()
-
getName
@Nonnull public java.lang.String getName()
- Returns:
- The field value
-
hasValue
public boolean hasValue()
-
getValue
@Nonnull public java.lang.String getValue()
- Returns:
- The field value
-
numAnnotations
public int numAnnotations()
-
hasAnnotations
public boolean hasAnnotations()
-
getAnnotations
public java.util.Map<java.lang.String,java.lang.String> getAnnotations()
- Returns:
- The field value
-
optionalAnnotations
@Nonnull public java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> optionalAnnotations()
- Returns:
- Optional field value
-
hasStartLineNo
public boolean hasStartLineNo()
-
getStartLineNo
public int getStartLineNo()
Note the start of the const in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.- Returns:
- The field value
-
optionalStartLineNo
@Nonnull public java.util.OptionalInt optionalStartLineNo()
Note the start of the const in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.- Returns:
- Optional field value
-
hasStartLinePos
public boolean hasStartLinePos()
-
getStartLinePos
public int getStartLinePos()
- Returns:
- The field value
-
optionalStartLinePos
@Nonnull public java.util.OptionalInt optionalStartLinePos()
- Returns:
- Optional field value
-
has
public boolean has(int key)
- Specified by:
has
in interfacePMessage<ConstType,ConstType._Field>
- Parameters:
key
- The key of the field.- Returns:
- Whether the field is present.
-
get
public <T> T get(int key)
- Specified by:
get
in interfacePMessage<ConstType,ConstType._Field>
- 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<ConstType,ConstType._Field>
- Specified by:
asString
in interfacenet.morimekta.util.Stringable
- Returns:
- String representation.
-
compareTo
public int compareTo(ConstType other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ConstType>
-
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, PMessage)
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 ConstType._Builder mutate()
Description copied from interface:PMessage
Get a builder that extends the current object.- Specified by:
mutate
in interfacePMessage<ConstType,ConstType._Field>
- Returns:
- The builder instance.
-
provider
@Nonnull public static PStructDescriptorProvider<ConstType,ConstType._Field> provider()
-
descriptor
@Nonnull public PStructDescriptor<ConstType,ConstType._Field> descriptor()
- Specified by:
descriptor
in interfacePMessage<ConstType,ConstType._Field>
- Specified by:
descriptor
in interfacePValue<ConstType>
-
builder
public static ConstType._Builder builder()
Make a providence_model.ConstType builder.- Returns:
- The builder instance.
-
-