public FilterJob toFilterJob(final boolean validate, final AnalysisJobImmutabilizer immutabilizer) {
if (validate && !isConfigured(true)) {
throw new IllegalStateException("Filter job is not correctly configured");
}
final ComponentRequirement componentRequirement = immutabilizer.load(getComponentRequirement());
final OutputDataStreamJob[] outputDataStreamJobs = immutabilizer.load(getOutputDataStreamJobs(), validate);
if (_cachedJob == null) {
_cachedJob = new ImmutableFilterJob(getName(), getDescriptor(),
new ImmutableComponentConfiguration(getConfiguredProperties()), componentRequirement,
getMetadataProperties(), outputDataStreamJobs);
} else {
final ImmutableFilterJob newFilterJob = new ImmutableFilterJob(getName(), getDescriptor(),
new ImmutableComponentConfiguration(getConfiguredProperties()), componentRequirement,
getMetadataProperties(), outputDataStreamJobs);
if (!newFilterJob.equals(_cachedJob)) {
_cachedJob = newFilterJob;
}
}
return _cachedJob;
}