title: java.lang.IllegalArgumentException: No enum constant found
body: <p>I have this Enum which I would like to use to set different statuses:</p>
  <pre><code>@Enumerated(EnumType.STRING)
  @Column(name = &quot;status&quot;, length = 20)
  private OnboardingTaskStatus status; 
  
  public enum OnboardingTaskStatus {
      NEW,
      IN_PROGRESS,
      DISABLED,
  }
  </code></pre>
  <p>When I try to builds search specification I get this:</p>
  <pre><code>public Page&lt;OnboardingTaskDto&gt; findOnboardingTasks(OnboardingTaskSearchParams params, Pageable pageable){
          Specification&lt;OnboardingTasks&gt; spec = (root, query, cb) -&gt; {
              List&lt;Predicate&gt; predicates = new ArrayList&lt;&gt;();
              if (params.getStatus() != null) {
                  predicates.add(cb.equal(root.get(&quot;status&quot;), params.getStatus()));
              }
              return cb.and(predicates.toArray(new Predicate[predicates.size()]));
          };
          return onboardingTasksService.findAll(spec, pageable).map(onboardingMapper::taskToTaskDTO);
      }
  
  @Getter
  @Setter
  public class OnboardingTaskSearchParams {
      private String title;
      private String status;
  
      private LocalDateTime createdAt;
      private LocalDateTime updatedAt;
  }
  </code></pre>
  <p>I tried to update the status to this filed:</p>
  <pre><code>predicates.add(cb.equal(root.get(&quot;status&quot;), OnboardingTaskStatus.valueOf(params.getStatus())));
  </code></pre>
  <p>But I get error:</p>
  <blockquote>
  <p>OnboardingTaskStatus.2769df0841; nested exception is java.lang.IllegalArgumentException: No enum constant OnboardingTaskStatus.2769df0841] with root cause
  java.lang.IllegalArgumentException: No enum constant OnboardingTaskStatus.2769df0841</p>
  </blockquote>
  <p><em><strong>Do you know what is the proper way to implement the Enum search without throwing an error if the value is not found?</strong></em></p>