Class JMessage<T extends net.morimekta.providence.reflect.contained.CMessage<T>>
- java.lang.Object
-
- net.morimekta.providence.generator.format.java.utils.JMessage<T>
-
@Immutable public class JMessage<T extends net.morimekta.providence.reflect.contained.CMessage<T>> extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<JField>declaredOrderFields()net.morimekta.providence.descriptor.PMessageDescriptor<T>descriptor()java.lang.StringexceptionBaseClass()java.util.Optional<JField>exceptionMessageField()If the message has a 'string' field named 'message', which can be used as the 'message' for exceptions.java.lang.StringextraImplements()java.lang.StringgetDescriptorClass()java.lang.StringgetExceptionMessageFieldName()java.lang.StringgetProviderClass()booleanhasAnnotation(java.lang.String annotation)Check if the annotation is present.booleanhasAnnotation(net.morimekta.providence.descriptor.PAnnotation annotation)Check if the annotation is present.java.lang.StringinstanceType()The short class name of the message.booleanisException()booleanisUnion()booleanjsonCompactible()java.util.List<JField>numericalOrderFields()net.morimekta.providence.PMessageVariantvariant()
-
-
-
Method Detail
-
descriptor
public net.morimekta.providence.descriptor.PMessageDescriptor<T> descriptor()
-
variant
public net.morimekta.providence.PMessageVariant variant()
-
isException
public boolean isException()
-
isUnion
public boolean isUnion()
-
jsonCompactible
public boolean jsonCompactible()
-
instanceType
public java.lang.String instanceType()
The short class name of the message.- Returns:
- The class short name.
-
declaredOrderFields
public java.util.List<JField> declaredOrderFields()
-
numericalOrderFields
public java.util.List<JField> numericalOrderFields()
-
getDescriptorClass
public java.lang.String getDescriptorClass() throws net.morimekta.providence.generator.GeneratorException- Throws:
net.morimekta.providence.generator.GeneratorException
-
getProviderClass
public java.lang.String getProviderClass() throws net.morimekta.providence.generator.GeneratorException- Throws:
net.morimekta.providence.generator.GeneratorException
-
extraImplements
public java.lang.String extraImplements()
-
exceptionBaseClass
public java.lang.String exceptionBaseClass()
-
exceptionMessageField
public java.util.Optional<JField> exceptionMessageField()
If the message has a 'string' field named 'message', which can be used as the 'message' for exceptions.- Returns:
- Optional message field.
-
getExceptionMessageFieldName
@Nonnull public java.lang.String getExceptionMessageFieldName()
-
hasAnnotation
public boolean hasAnnotation(net.morimekta.providence.descriptor.PAnnotation annotation)
Check if the annotation is present.- Parameters:
annotation- The annotation to check.- Returns:
- True if the annotaiton is present.
-
hasAnnotation
public boolean hasAnnotation(java.lang.String annotation)
Check if the annotation is present.- Parameters:
annotation- The annotation to check.- Returns:
- True if the annotaiton is present.
-
-