Package net.morimekta.providence.util
Enum ThriftAnnotation
- java.lang.Object
-
- java.lang.Enum<ThriftAnnotation>
-
- net.morimekta.providence.util.ThriftAnnotation
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ThriftAnnotation>
public enum ThriftAnnotation extends java.lang.Enum<ThriftAnnotation>
Enum containing known "general" thrift annotations. Note that annotation tags are case sensitive, values depends on the implementation details.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONTAINER
Whether a set-like container are normal (hash-), ordered (linked-hash-) or sorted (tree-).DEPRECATED
If the field, message, service or method is not supposed to be used any more.JAVA_EXCEPTION_CLASS
Specify exception class to extend for exception structs.JAVA_HAZELCAST_CLASS_ID
Specify if a struct should be generated using hazelcast.portable interface to be compatible with serialization and deserialization of hazelcast portable.JAVA_HAZELCAST_FACTORY_ID
Specify if a file should generate with support with hazelcast portable implementation.JAVA_IMPLEMENTS
Add extra interfaces to a struct.JAVA_PUBLIC_CONSTRUCTOR
For struct and exception.JAVA_SERVICE_METHOD_THROWS
Specify an exception class to throw instead of the default declared exceptions.JSON_COMPACT
If a struct can use a compact serialized format.MESSAGE_FIELD
Specify which field to use for the exception message.NONE
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
tag
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThriftAnnotation
forTag(java.lang.String tag)
static ThriftAnnotation
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ThriftAnnotation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final ThriftAnnotation NONE
-
CONTAINER
public static final ThriftAnnotation CONTAINER
Whether a set-like container are normal (hash-), ordered (linked-hash-) or sorted (tree-). Valid for set and map type fields.container = "ordered"
See the
ThriftContainer
enum for valid values, and how it is handled.
-
DEPRECATED
public static final ThriftAnnotation DEPRECATED
If the field, message, service or method is not supposed to be used any more. Whatever is in the value part may be used as the 'deprecated' reason.deprecated = "For some reason"
-
JSON_COMPACT
public static final ThriftAnnotation JSON_COMPACT
If a struct can use a compact serialized format. Only valid for struct, not for union or exception.json.compact = ""
-
MESSAGE_FIELD
public static final ThriftAnnotation MESSAGE_FIELD
Specify which field to use for the exception message. The default is to use the 'message' field, and if neither is set, then a toString variant will be used as the message.message.field = "field_name"
-
JAVA_IMPLEMENTS
public static final ThriftAnnotation JAVA_IMPLEMENTS
Add extra interfaces to a struct. Not allowed on unions or exceptions. The interface methods must either match the methods implemented by the struct, or have a default implementation.java.implements = "my.package.MyInterface"
-
JAVA_EXCEPTION_CLASS
public static final ThriftAnnotation JAVA_EXCEPTION_CLASS
Specify exception class to extend for exception structs. The default is to extendException
, this will override that verbatim. The exception class must be available at compile time.java.exception.class = "my.package.MyException"
-
JAVA_PUBLIC_CONSTRUCTOR
public static final ThriftAnnotation JAVA_PUBLIC_CONSTRUCTOR
For struct and exception. If true will add a public create constructor with all fields available as parameters. Default is not.java.public.constructor = ""
-
JAVA_SERVICE_METHOD_THROWS
public static final ThriftAnnotation JAVA_SERVICE_METHOD_THROWS
Specify an exception class to throw instead of the default declared exceptions. This is only valid for the Service.Iface interface, and not for the Service.Client implementation.Non-declared exceptions, even if extending the declared exception, will be handled as a system failure, and wrapped in an IOException or sent as an application exception.
java.service.methods.throws = "my.package.MyException"
-
JAVA_HAZELCAST_FACTORY_ID
public static final ThriftAnnotation JAVA_HAZELCAST_FACTORY_ID
Specify if a file should generate with support with hazelcast portable implementation.The id needs to be a unique int id for each program that is generated with support for hazelcast.
hazelcast.factory.id = "1"
-
JAVA_HAZELCAST_CLASS_ID
public static final ThriftAnnotation JAVA_HAZELCAST_CLASS_ID
Specify if a struct should be generated using hazelcast.portable interface to be compatible with serialization and deserialization of hazelcast portable.The id needs to be a unique int id for each struct in the program.
hazelcast.factory.id = "1"
-
-
Method Detail
-
values
public static ThriftAnnotation[] 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 (ThriftAnnotation c : ThriftAnnotation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ThriftAnnotation 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
-
forTag
@Nonnull public static ThriftAnnotation forTag(@Nonnull java.lang.String tag)
-
-