Package net.morimekta.providence.model
Class Declaration
- java.lang.Object
-
- net.morimekta.providence.model.Declaration
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Declaration>
,Decl
,Declaration_OrBuilder
,net.morimekta.providence.PMessage<Declaration>
,net.morimekta.providence.PMessageOrBuilder<Declaration>
,net.morimekta.providence.PUnion<Declaration>
,net.morimekta.providence.PValue<Declaration>
,net.morimekta.providence.serializer.binary.BinaryWriter
,net.morimekta.util.Stringable
@Generated(value="net.morimekta.providence:providence-generator-java", comments="java:serializable") @Immutable public class Declaration extends java.lang.Object implements Decl, Declaration_OrBuilder, net.morimekta.providence.PUnion<Declaration>, java.lang.Comparable<Declaration>, java.io.Serializable, net.morimekta.providence.serializer.binary.BinaryWriter
( <enum> | <typedef> | <struct> | <service> | <const> )- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Declaration._Builder
( <enum> | <typedef> | <struct> | <service> | <const> )static class
Declaration._Field
-
Field Summary
Fields Modifier and Type Field Description static net.morimekta.providence.descriptor.PUnionDescriptor<Declaration>
kDescriptor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Decl
asDecl()
java.lang.String
asString()
static Declaration._Builder
builder()
Make ap_model.Declaration
builder.int
compareTo(Declaration other)
net.morimekta.providence.descriptor.PUnionDescriptor<Declaration>
descriptor()
boolean
equals(java.lang.Object o)
<T> T
get(int key)
ConstType
getDeclConst()
EnumType
getDeclEnum()
MessageType
getDeclMessage()
ServiceType
getDeclService()
TypedefType
getDeclTypedef()
java.lang.String
getDocumentation()
Documentation for the specific declaration.java.lang.String
getName()
Name of the type, constant or service.boolean
has(int key)
boolean
hasDeclConst()
boolean
hasDeclEnum()
boolean
hasDeclMessage()
boolean
hasDeclService()
boolean
hasDeclTypedef()
boolean
hasDocumentation()
int
hashCode()
boolean
hasName()
Declaration._Builder
mutate()
java.util.Optional<ConstType>
optionalDeclConst()
java.util.Optional<EnumType>
optionalDeclEnum()
java.util.Optional<MessageType>
optionalDeclMessage()
java.util.Optional<ServiceType>
optionalDeclService()
java.util.Optional<TypedefType>
optionalDeclTypedef()
java.util.Optional<java.lang.String>
optionalDocumentation()
Documentation for the specific declaration.static net.morimekta.providence.descriptor.PUnionDescriptorProvider<Declaration>
provider()
java.lang.String
toString()
Declaration._Field
unionField()
boolean
unionFieldIsSet()
static Declaration
withDeclConst(ConstType_OrBuilder value)
static Declaration
withDeclEnum(EnumType_OrBuilder value)
static Declaration
withDeclMessage(MessageType_OrBuilder value)
static Declaration
withDeclService(ServiceType_OrBuilder value)
static Declaration
withDeclTypedef(TypedefType_OrBuilder value)
int
writeBinary(net.morimekta.util.io.BigEndianBinaryWriter writer)
-
-
-
Field Detail
-
kDescriptor
public static final net.morimekta.providence.descriptor.PUnionDescriptor<Declaration> kDescriptor
-
-
Method Detail
-
withDeclEnum
@Nonnull public static Declaration withDeclEnum(@Nonnull EnumType_OrBuilder value)
- Parameters:
value
- The union value- Returns:
- The created union.
-
withDeclTypedef
@Nonnull public static Declaration withDeclTypedef(@Nonnull TypedefType_OrBuilder value)
- Parameters:
value
- The union value- Returns:
- The created union.
-
withDeclMessage
@Nonnull public static Declaration withDeclMessage(@Nonnull MessageType_OrBuilder value)
- Parameters:
value
- The union value- Returns:
- The created union.
-
withDeclService
@Nonnull public static Declaration withDeclService(@Nonnull ServiceType_OrBuilder value)
- Parameters:
value
- The union value- Returns:
- The created union.
-
withDeclConst
@Nonnull public static Declaration withDeclConst(@Nonnull ConstType_OrBuilder value)
- Parameters:
value
- The union value- Returns:
- The created union.
-
hasDeclEnum
public boolean hasDeclEnum()
- Specified by:
hasDeclEnum
in interfaceDeclaration_OrBuilder
- Returns:
- If decl_enum is present.
-
getDeclEnum
public EnumType getDeclEnum()
- Specified by:
getDeclEnum
in interfaceDeclaration_OrBuilder
- Returns:
- The
decl_enum
value
-
optionalDeclEnum
@Nonnull public java.util.Optional<EnumType> optionalDeclEnum()
- Specified by:
optionalDeclEnum
in interfaceDeclaration_OrBuilder
- Returns:
- Optional of the
decl_enum
field value.
-
hasDeclTypedef
public boolean hasDeclTypedef()
- Specified by:
hasDeclTypedef
in interfaceDeclaration_OrBuilder
- Returns:
- If decl_typedef is present.
-
getDeclTypedef
public TypedefType getDeclTypedef()
- Specified by:
getDeclTypedef
in interfaceDeclaration_OrBuilder
- Returns:
- The
decl_typedef
value
-
optionalDeclTypedef
@Nonnull public java.util.Optional<TypedefType> optionalDeclTypedef()
- Specified by:
optionalDeclTypedef
in interfaceDeclaration_OrBuilder
- Returns:
- Optional of the
decl_typedef
field value.
-
hasDeclMessage
public boolean hasDeclMessage()
- Specified by:
hasDeclMessage
in interfaceDeclaration_OrBuilder
- Returns:
- If decl_message is present.
-
getDeclMessage
public MessageType getDeclMessage()
- Specified by:
getDeclMessage
in interfaceDeclaration_OrBuilder
- Returns:
- The
decl_message
value
-
optionalDeclMessage
@Nonnull public java.util.Optional<MessageType> optionalDeclMessage()
- Specified by:
optionalDeclMessage
in interfaceDeclaration_OrBuilder
- Returns:
- Optional of the
decl_message
field value.
-
hasDeclService
public boolean hasDeclService()
- Specified by:
hasDeclService
in interfaceDeclaration_OrBuilder
- Returns:
- If decl_service is present.
-
getDeclService
public ServiceType getDeclService()
- Specified by:
getDeclService
in interfaceDeclaration_OrBuilder
- Returns:
- The
decl_service
value
-
optionalDeclService
@Nonnull public java.util.Optional<ServiceType> optionalDeclService()
- Specified by:
optionalDeclService
in interfaceDeclaration_OrBuilder
- Returns:
- Optional of the
decl_service
field value.
-
hasDeclConst
public boolean hasDeclConst()
- Specified by:
hasDeclConst
in interfaceDeclaration_OrBuilder
- Returns:
- If decl_const is present.
-
getDeclConst
public ConstType getDeclConst()
- Specified by:
getDeclConst
in interfaceDeclaration_OrBuilder
- Returns:
- The
decl_const
value
-
optionalDeclConst
@Nonnull public java.util.Optional<ConstType> optionalDeclConst()
- Specified by:
optionalDeclConst
in interfaceDeclaration_OrBuilder
- Returns:
- Optional of the
decl_const
field value.
-
asDecl
public Decl asDecl()
- Returns:
- The union field as implemented type.
-
getDocumentation
public java.lang.String getDocumentation()
Documentation for the specific declaration.- Specified by:
getDocumentation
in interfaceDecl
- Returns:
- The documentation value.
-
optionalDocumentation
@Nonnull public java.util.Optional<java.lang.String> optionalDocumentation()
Documentation for the specific declaration.- Specified by:
optionalDocumentation
in interfaceDecl
- Returns:
- Optional documentation value.
-
hasDocumentation
public boolean hasDocumentation()
- Specified by:
hasDocumentation
in interfaceDecl
- Returns:
- If documentation is present.
-
getName
@Nonnull public java.lang.String getName()
Name of the type, constant or service.
-
hasName
public boolean hasName()
-
has
public boolean has(int key)
- Specified by:
has
in interfacenet.morimekta.providence.PMessageOrBuilder<Declaration>
-
get
public <T> T get(int key)
- Specified by:
get
in interfacenet.morimekta.providence.PMessageOrBuilder<Declaration>
-
unionFieldIsSet
public boolean unionFieldIsSet()
- Specified by:
unionFieldIsSet
in interfacenet.morimekta.providence.PUnion<Declaration>
-
unionField
@Nonnull public Declaration._Field unionField()
- Specified by:
unionField
in interfacenet.morimekta.providence.PUnion<Declaration>
-
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()
- Specified by:
asString
in interfacenet.morimekta.providence.PMessage<Declaration>
- Specified by:
asString
in interfacenet.morimekta.util.Stringable
-
compareTo
public int compareTo(Declaration other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Declaration>
-
writeBinary
public int writeBinary(net.morimekta.util.io.BigEndianBinaryWriter writer) throws java.io.IOException
- Specified by:
writeBinary
in interfacenet.morimekta.providence.serializer.binary.BinaryWriter
- Throws:
java.io.IOException
-
mutate
@Nonnull public Declaration._Builder mutate()
- Specified by:
mutate
in interfacenet.morimekta.providence.PMessage<Declaration>
-
provider
@Nonnull public static net.morimekta.providence.descriptor.PUnionDescriptorProvider<Declaration> provider()
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PUnionDescriptor<Declaration> descriptor()
- Specified by:
descriptor
in interfacenet.morimekta.providence.PMessageOrBuilder<Declaration>
- Specified by:
descriptor
in interfacenet.morimekta.providence.PValue<Declaration>
-
builder
public static Declaration._Builder builder()
Make ap_model.Declaration
builder.- Returns:
- The builder instance.
-
-