@Test public void httpCode() { assertEquals(400,Check.ParamInvalid.toCheckError().asHttpCode()); assertEquals(404,Check.NotFound.toCheckError().asHttpCode()); }
public CheckError toCheckError(CONTEXT context) { return CheckError.of(errorType,errorCode,message(context)); }
Check { public CheckError toCheckError(CONTEXT context) { return CheckError.of(errorType,errorCode,message(context)); } }
Check { public CheckError toCheckError(CONTEXT context) { return CheckError.of(errorType,errorCode,message(context)); } private  Check(CheckErrorType errorType,int errorCode,IRender<CONTEXT,String> render); }
Check { public CheckError toCheckError(CONTEXT context) { return CheckError.of(errorType,errorCode,message(context)); } private  Check(CheckErrorType errorType,int errorCode,IRender<CONTEXT,String> render); static Check<CONTEXT> of(CheckErrorType errorType,int errorCode, IRender<CONTEXT,String> render); static Check<CONTEXT> f(int errorCode, String messageTemplate,Class<CONTEXT> contextClass); static Check<CONTEXT> e(int errorCode, String messageTemplate,Class<CONTEXT> contextClass); static Check<Void> f(int errorCode, String messageTemplate); static Check<Void> e(int errorCode, String messageTemplate); void fail(CONTEXT context); void fail(Action1<CONTEXT> contextSetter); void fail(); CheckError toCheckError(CONTEXT context); CheckError toCheckError(); CheckError toCheckError(Action1<CONTEXT> contextSetter); String message(); String message(CONTEXT context); String message(Action1<CONTEXT> contextSetter); boolean check(boolean expression, CONTEXT context); boolean check(boolean expression, Action1<CONTEXT> contextSetter); boolean check(boolean expression); T checkNotNull(T reference,CONTEXT context); T checkNotNull(T reference,Action1<CONTEXT> contextSetter); T checkNotNull(T reference); String checkNotEmpty(String reference,CONTEXT context); String checkNotEmpty(String reference,Action1<CONTEXT> contextSetter); String checkNotEmpty(String reference); int getErrorCode(); }
Check { public CheckError toCheckError(CONTEXT context) { return CheckError.of(errorType,errorCode,message(context)); } private  Check(CheckErrorType errorType,int errorCode,IRender<CONTEXT,String> render); static Check<CONTEXT> of(CheckErrorType errorType,int errorCode, IRender<CONTEXT,String> render); static Check<CONTEXT> f(int errorCode, String messageTemplate,Class<CONTEXT> contextClass); static Check<CONTEXT> e(int errorCode, String messageTemplate,Class<CONTEXT> contextClass); static Check<Void> f(int errorCode, String messageTemplate); static Check<Void> e(int errorCode, String messageTemplate); void fail(CONTEXT context); void fail(Action1<CONTEXT> contextSetter); void fail(); CheckError toCheckError(CONTEXT context); CheckError toCheckError(); CheckError toCheckError(Action1<CONTEXT> contextSetter); String message(); String message(CONTEXT context); String message(Action1<CONTEXT> contextSetter); boolean check(boolean expression, CONTEXT context); boolean check(boolean expression, Action1<CONTEXT> contextSetter); boolean check(boolean expression); T checkNotNull(T reference,CONTEXT context); T checkNotNull(T reference,Action1<CONTEXT> contextSetter); T checkNotNull(T reference); String checkNotEmpty(String reference,CONTEXT context); String checkNotEmpty(String reference,Action1<CONTEXT> contextSetter); String checkNotEmpty(String reference); int getErrorCode(); static final Check<firebats.check.Check.GeneralFail> GeneralFail; static final Check<firebats.check.Check.GeneralException> GeneralException; static final Check<firebats.check.Check.ParamInvalid> ParamInvalid; static final Check<Void> ServiceTimeout; static final Check<firebats.check.Check.Unauthorized> Unauthorized; static final Check<firebats.check.Check.Forbidden> Forbidden; static final Check<firebats.check.Check.NotFound> NotFound; }