-
public final class EA generic and immutable error, containing helpful information
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleanhasCodeprivate final BooleanhasNameprivate final BooleanhasMessageprivate final BooleanhasCauseprivate final BooleanhasDataprivate final BooleanhasTimeprivate final Integercodeprivate final Stringnameprivate final Stringmessageprivate final List<E>causesprivate final Map<String, String>dataprivate final Longtime
-
Method Summary
Modifier and Type Method Description final Ecode(Integer c)Constructs an E containing given code final Ename(String n)Constructs an E containing given name final Emessage(String m)Constructs an E containing given message final Ecauses(List<E> c)Constructs an E adding given causes final Ecauses(Array<Out E> c)Constructs an E adding given causes final Ecause(E e)Constructs an E adding given cause final Edata(Map<String, String> d)Constructs an E adding given data final <V extends Any> Edata(String k, V v)Constructs an E adding given data entry final <V extends Any> Edata(Pair<String, V> p)Constructs an E adding given data entry final Etime(Long t)Constructs an E containing given time final Enow()Constructs an E containing time set to now final EcauseIf(Boolean condition, Function0<E> e)Constructs an E adding given cause if condition holds final <A extends Any> EOr<A>toEOr()Converts this E to a failed EOr<A> final EExceptiontoException()Converts this E into an exception StringtoString()final Integercomponent1()final Stringcomponent2()final Stringcomponent3()final List<E>component4()final Map<String, String>component5()final Longcomponent6()final Ecopy(Integer code, String name, String message, List<E> causes, Map<String, String> data, Long time)final BooleangetHasCode()Whether or not a code is set final BooleangetHasName()Whether or not a name is set final BooleangetHasMessage()Whether or not a message is set final BooleangetHasCause()Whether or not a cause is set final BooleangetHasData()Whether or not a data is set final BooleangetHasTime()Whether or not a time is set final IntegergetCode()final StringgetName()final StringgetMessage()final List<E>getCauses()final Map<String, String>getData()final LonggetTime()-
-
Method Detail
-
message
final E message(String m)
Constructs an E containing given message- Parameters:
m- Message to set
-
causes
final E causes(List<E> c)
Constructs an E adding given causes- Parameters:
c- Causes as a List
-
causes
final E causes(Array<Out E> c)
Constructs an E adding given causes- Parameters:
c- Causes as variable arguments
-
data
final E data(Map<String, String> d)
Constructs an E adding given data- Parameters:
d- Data as a key-value map
-
data
final <V extends Any> E data(String k, V v)
Constructs an E adding given data entry- Parameters:
k- Key of data entryv- Value of data entry
-
data
final <V extends Any> E data(Pair<String, V> p)
Constructs an E adding given data entry- Parameters:
p- Data entry
-
causeIf
final E causeIf(Boolean condition, Function0<E> e)
Constructs an E adding given cause if condition holds- Parameters:
condition- Some condition on which to add the causee- A cause
-
toException
final EException toException()
Converts this E into an exception
-
component1
final Integer component1()
-
component2
final String component2()
-
component3
final String component3()
-
component4
final List<E> component4()
-
component5
final Map<String, String> component5()
-
component6
final Long component6()
-
copy
final E copy(Integer code, String name, String message, List<E> causes, Map<String, String> data, Long time)
-
getHasCode
final Boolean getHasCode()
Whether or not a code is set
-
getHasName
final Boolean getHasName()
Whether or not a name is set
-
getHasMessage
final Boolean getHasMessage()
Whether or not a message is set
-
getHasCause
final Boolean getHasCause()
Whether or not a cause is set
-
getHasData
final Boolean getHasData()
Whether or not a data is set
-
getHasTime
final Boolean getHasTime()
Whether or not a time is set
-
getMessage
final String getMessage()
-
-
-
-