title: Enums that hold Conditional Logic - Possible?
body: <p>To clarify, I want something like this:</p>
  
  <pre><code>MESSAGE_1042("messageText", p -&gt; p.contains(MESSAGE_1032), p -&gt; p.isAThing());
  </code></pre>
  
  <p>Where later, I can call as such:</p>
  
  <pre><code>for (Message message : Messages) {
      if (message.conditionsMet()) {
          //doTheThing
      }
  }
  </code></pre>
  
  <p>I don't actually care if I can use lambdas, or Predicates, or how I set the conditions, or how they're tested. I know that I could do this with my own classes, where I just extend the class and implement conditionsMet() for each individual class.</p>
  
  <p>However, I expect I will eventually have a LOT of these things, and I don't want to have a package containing hundreds of classes, when I could have a single Enum with many lines instead.</p>
  
  <p>For more background information: this is for a personal project. A sort of interactive story I'm working on, and these messages are things the user can say. However, there can be multiple conditions that might determine if they have the option to actually say a message.</p>
  
  <p>If I can store the conditions in the enum holding the text, then that's more convenient to me. When I'm working with the enum itself in my other code, I won't have to worry about its special conditions. It knows its own conditions before it's allowed to be used, and I want to just ask it if those conditions are met.</p>
  
  <p>So is there any reasonable way to obtain this in an enum? Or am I going to have to just accept having lots of classes?</p>