/** * Build a preprocessor DTO from a filter info * @param info The preprocessor info * @return A preprocessor DTO */ public static @NotNull PreprocessorDTO build(@NotNull final PreprocessorInfo info, final int reason) { final PreprocessorDTO dto = (reason != -1 ? new FailedPreprocessorDTO() : new PreprocessorDTO()); dto.initParams = info.getInitParameters(); dto.serviceId = info.getServiceId(); if ( reason != -1 ) { ((FailedPreprocessorDTO)dto).failureReason = reason; } return dto; } }
/** * Build a preprocessor DTO from a filter info * @param info The preprocessor info * @return A preprocessor DTO */ public static @NotNull PreprocessorDTO build(@NotNull final PreprocessorInfo info, final int reason) { final PreprocessorDTO dto = (reason != -1 ? new FailedPreprocessorDTO() : new PreprocessorDTO()); dto.initParams = info.getInitParameters(); dto.serviceId = info.getServiceId(); if ( reason != -1 ) { ((FailedPreprocessorDTO)dto).failureReason = reason; } return dto; } }