Package net.morimekta.providence.model
Enum MessageVariant
- java.lang.Object
-
- java.lang.Enum<MessageVariant>
-
- net.morimekta.providence.model.MessageVariant
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<MessageVariant>
,PEnumValue<MessageVariant>
,PValue<MessageVariant>
,net.morimekta.util.Numeric
,net.morimekta.util.Stringable
@Generated(value="net.morimekta.providence:providence-generator-java", comments="java:serializable") public enum MessageVariant extends java.lang.Enum<MessageVariant> implements PEnumValue<MessageVariant>
Struct variant for StructType. The lower-case of the enum value is the thrift keyword.STRUCT: Normal Structure. UNION: Only one field set to be valid. EXCEPTION: Handled as exception (Java, Python etc.).
Providence Only:
INTERFACE: Not a real type. Only interface. Struct can 'implement' this And will then require to have matching fields. Field ids not allowed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MessageVariant._Builder
-
Field Summary
Fields Modifier and Type Field Description static PEnumDescriptor<MessageVariant>
kDescriptor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
asInteger()
java.lang.String
asString()
PEnumDescriptor<MessageVariant>
descriptor()
static MessageVariant
findById(java.lang.Integer id)
Find a value based in its IDstatic MessageVariant
findByName(java.lang.String name)
Find a value based in its namestatic PEnumDescriptorProvider<MessageVariant>
provider()
static MessageVariant
valueForId(int id)
Get a value based in its IDstatic MessageVariant
valueForName(java.lang.String name)
Get a value based in its namestatic MessageVariant
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static MessageVariant[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STRUCT
public static final MessageVariant STRUCT
-
UNION
public static final MessageVariant UNION
-
EXCEPTION
public static final MessageVariant EXCEPTION
-
INTERFACE
public static final MessageVariant INTERFACE
-
-
Field Detail
-
kDescriptor
public static final PEnumDescriptor<MessageVariant> kDescriptor
-
-
Method Detail
-
values
public static MessageVariant[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MessageVariant c : MessageVariant.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MessageVariant valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
asInteger
public int asInteger()
- Specified by:
asInteger
in interfacenet.morimekta.util.Numeric
-
asString
@Nonnull public java.lang.String asString()
- Specified by:
asString
in interfacenet.morimekta.util.Stringable
-
findById
@Nullable public static MessageVariant findById(java.lang.Integer id)
Find a value based in its ID- Parameters:
id
- Id of value- Returns:
- Value found or null
-
findByName
@Nullable public static MessageVariant findByName(java.lang.String name)
Find a value based in its name- Parameters:
name
- Name of value- Returns:
- Value found or null
-
valueForId
@Nonnull public static MessageVariant valueForId(int id)
Get a value based in its ID- Parameters:
id
- Id of value- Returns:
- Value found
- Throws:
java.lang.IllegalArgumentException
- If no value for id is found
-
valueForName
@Nonnull public static MessageVariant valueForName(@Nonnull java.lang.String name)
Get a value based in its name- Parameters:
name
- Name of value- Returns:
- Value found
- Throws:
java.lang.IllegalArgumentException
- If no value for name is found, or null name
-
descriptor
public PEnumDescriptor<MessageVariant> descriptor()
- Specified by:
descriptor
in interfacePEnumValue<MessageVariant>
- Specified by:
descriptor
in interfacePValue<MessageVariant>
-
provider
public static PEnumDescriptorProvider<MessageVariant> provider()
-
-