Package net.morimekta.providence
Class PApplicationException._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<PApplicationException>
-
- net.morimekta.providence.PApplicationException._Builder
-
- All Implemented Interfaces:
PApplicationException_OrBuilder
,PMessageOrBuilder<PApplicationException>
,PValue<PApplicationException>
,BinaryReader
- Enclosing class:
- PApplicationException
public static class PApplicationException._Builder extends PMessageBuilder<PApplicationException> implements PApplicationException_OrBuilder, BinaryReader
Base exception thrown on non-declared exceptions on a service call, and other server-side service call issues.
-
-
Constructor Summary
Constructors Constructor Description _Builder()
Make a p_service.PApplicationException builder instance._Builder(PApplicationException base)
Make a mutating builder off a base p_service.PApplicationException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PApplicationException._Builder
addTo(int key, java.lang.Object value)
Adds a value to a set or list container.PApplicationException
build()
PApplicationException._Builder
clear(int key)
Clear the provided field value.PApplicationException._Builder
clearMessage()
Clear themessage
field.PApplicationException._Builder
clearType()
Clear thetype
field.PExceptionDescriptor<PApplicationException>
descriptor()
boolean
equals(java.lang.Object o)
<T> T
get(int key)
java.lang.String
getMessage()
Exception message.PApplicationExceptionType
getType()
The application exception type.boolean
has(int key)
int
hashCode()
boolean
hasMessage()
Checks for presence of themessage
field.boolean
hasType()
Checks for presence of thetype
field.PApplicationException._Builder
initCause(java.lang.Throwable cause)
Initializes the cause of the p_service.PApplicationExceptionboolean
isModified(int key)
Checks if a specific field is modified on the builder.boolean
isModifiedMessage()
Checks if themessage
field has been modified since the builder was created.boolean
isModifiedType()
Checks if thetype
field has been modified since the builder was created.boolean
isSet(int key)
Checks if a specific field is set on the builder.boolean
isSetMessage()
Checks for explicit presence of themessage
field.boolean
isSetType()
Checks for explicit presence of thetype
field.PApplicationException._Builder
merge(PApplicationException from)
Merges the provided message into the builder.PMessageBuilder
mutator(int key)
Get the builder for the given message contained in this builder.java.util.Optional<java.lang.String>
optionalMessage()
Exception message.java.util.Optional<PApplicationExceptionType>
optionalType()
The application exception type.void
readBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)
Read the binary content into the current builder.PApplicationException._Builder
set(int key, java.lang.Object value)
Set the provided field value.PApplicationException._Builder
setMessage(java.lang.String value)
Set themessage
field value.PApplicationException._Builder
setType(PApplicationExceptionType value)
Set thetype
field value.boolean
valid()
Checks if the current set data is enough to make a valid struct.PApplicationException._Builder
validate()
Checks if the current set data is enough to make a valid struct.-
Methods inherited from class net.morimekta.providence.PMessageBuilder
addTo, clear, isModified, isSet, modifiedFields, mutator, presentFields, set
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.PMessageOrBuilder
get, has, toBuilder, toMessage
-
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a p_service.PApplicationException builder instance.
-
_Builder
public _Builder(PApplicationException base)
Make a mutating builder off a base p_service.PApplicationException.- Parameters:
base
- The base PApplicationException
-
-
Method Detail
-
merge
@Nonnull public PApplicationException._Builder merge(PApplicationException from)
Description copied from class:PMessageBuilder
Merges the provided message into the builder. Contained messages should in turn be merged and not replaced wholesale. Sets are unioned (addAll) and maps will overwrite / replace on a per-key basis (putAll).- Specified by:
merge
in classPMessageBuilder<PApplicationException>
- Parameters:
from
- The message to merge values from.- Returns:
- The builder itself.
-
setMessage
@Nonnull public PApplicationException._Builder setMessage(java.lang.String value)
Set themessage
field value.Exception message.
- Parameters:
value
- The new value- Returns:
- The builder
-
isSetMessage
public boolean isSetMessage()
Checks for explicit presence of themessage
field.- Returns:
- True if message has been set.
-
hasMessage
public boolean hasMessage()
Checks for presence of themessage
field.- Specified by:
hasMessage
in interfacePApplicationException_OrBuilder
- Returns:
- True if message is present.
-
isModifiedMessage
public boolean isModifiedMessage()
Checks if themessage
field has been modified since the builder was created.- Returns:
- True if message has been modified.
-
clearMessage
@Nonnull public PApplicationException._Builder clearMessage()
Clear themessage
field.- Returns:
- The builder
-
getMessage
public java.lang.String getMessage()
Exception message.- Specified by:
getMessage
in interfacePApplicationException_OrBuilder
- Returns:
- The
message
field value
-
optionalMessage
@Nonnull public java.util.Optional<java.lang.String> optionalMessage()
Exception message.- Specified by:
optionalMessage
in interfacePApplicationException_OrBuilder
- Returns:
- Optional
message
field value
-
setType
@Nonnull public PApplicationException._Builder setType(PApplicationExceptionType value)
Set thetype
field value.The application exception type.
- Parameters:
value
- The new value- Returns:
- The builder
-
isSetType
public boolean isSetType()
Checks for explicit presence of thetype
field.- Returns:
- True if type has been set.
-
hasType
public boolean hasType()
Checks for presence of thetype
field.- Specified by:
hasType
in interfacePApplicationException_OrBuilder
- Returns:
- True if type is present.
-
isModifiedType
public boolean isModifiedType()
Checks if thetype
field has been modified since the builder was created.- Returns:
- True if type has been modified.
-
clearType
@Nonnull public PApplicationException._Builder clearType()
Clear thetype
field.- Returns:
- The builder
-
getType
public PApplicationExceptionType getType()
The application exception type.- Specified by:
getType
in interfacePApplicationException_OrBuilder
- Returns:
- The
type
field value
-
optionalType
@Nonnull public java.util.Optional<PApplicationExceptionType> optionalType()
The application exception type.- Specified by:
optionalType
in interfacePApplicationException_OrBuilder
- Returns:
- Optional
type
field value
-
initCause
@Nonnull public PApplicationException._Builder initCause(java.lang.Throwable cause)
Initializes the cause of the p_service.PApplicationException- Parameters:
cause
- The cause- Returns:
- Builder instance
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
mutator
public PMessageBuilder mutator(int key)
Description copied from class:PMessageBuilder
Get the builder for the given message contained in this builder. If the sub-builder does not exist, create, either from existing instance or from scratch.- Specified by:
mutator
in classPMessageBuilder<PApplicationException>
- Parameters:
key
- The field key.- Returns:
- The field builder.
-
set
@Nonnull public PApplicationException._Builder set(int key, java.lang.Object value)
Description copied from class:PMessageBuilder
Set the provided field value.- Specified by:
set
in classPMessageBuilder<PApplicationException>
- Parameters:
key
- The key of the field to set.value
- The value to be set.- Returns:
- The message builder.
-
isSet
public boolean isSet(int key)
Description copied from class:PMessageBuilder
Checks if a specific field is set on the builder.- Specified by:
isSet
in classPMessageBuilder<PApplicationException>
- Parameters:
key
- The key of the field to check.- Returns:
- True if the field is set.
-
isModified
public boolean isModified(int key)
Description copied from class:PMessageBuilder
Checks if a specific field is modified on the builder.- Specified by:
isModified
in classPMessageBuilder<PApplicationException>
- Parameters:
key
- The key of the field to check.- Returns:
- True if the field is modified.
-
get
public <T> T get(int key)
- Specified by:
get
in interfacePMessageOrBuilder<PApplicationException>
- Type Parameters:
T
- The return type.- Parameters:
key
- The key of the field.- Returns:
- The value of the field.
-
has
public boolean has(int key)
- Specified by:
has
in interfacePMessageOrBuilder<PApplicationException>
- Parameters:
key
- The key of the field.- Returns:
- Whether the field is present.
-
addTo
@Nonnull public PApplicationException._Builder addTo(int key, java.lang.Object value)
Description copied from class:PMessageBuilder
Adds a value to a set or list container.- Specified by:
addTo
in classPMessageBuilder<PApplicationException>
- Parameters:
key
- The key of the container field to add too.value
- The value to add.- Returns:
- The builder itself.
-
clear
@Nonnull public PApplicationException._Builder clear(int key)
Description copied from class:PMessageBuilder
Clear the provided field value.- Specified by:
clear
in classPMessageBuilder<PApplicationException>
- Parameters:
key
- The key of the field to clear.- Returns:
- The builder itself.
-
valid
public boolean valid()
Description copied from class:PMessageBuilder
Checks if the current set data is enough to make a valid struct. It will check for all required fields, and if any are missing it will return false.- Specified by:
valid
in classPMessageBuilder<PApplicationException>
- Returns:
- True for a valid message.
-
validate
public PApplicationException._Builder validate()
Description copied from class:PMessageBuilder
Checks if the current set data is enough to make a valid struct. It will check for all required fields, and if any are missing it will throw anIllegalStateException
with an appropriate error message.- Specified by:
validate
in classPMessageBuilder<PApplicationException>
- Returns:
- The builder itself.
-
descriptor
@Nonnull public PExceptionDescriptor<PApplicationException> descriptor()
- Specified by:
descriptor
in interfacePMessageOrBuilder<PApplicationException>
- Specified by:
descriptor
in interfacePValue<PApplicationException>
-
readBinary
public void readBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict) throws java.io.IOException
Description copied from interface:BinaryReader
Read the binary content into the current builder. NOTE: This method is not intended to be used directly. Instead use theBinarySerializer.deserialize(InputStream, PMessageDescriptor)
call.- Specified by:
readBinary
in interfaceBinaryReader
- Parameters:
reader
- The reader to read from.strict
- If content should be handled strictly. True means to fail on everything that Apache thrift failed read() on.- Throws:
java.io.IOException
- When unable to read message for any reason.
-
build
@Nonnull public PApplicationException build()
- Specified by:
build
in classPMessageBuilder<PApplicationException>
-
-