title: Spring's @Condtional annotation with Java 8
body: <p>I was using <code>@Conditional</code> annotation and had to provide implementation of <code>matches()</code> of <code>Condition</code> interface. Since the <code>Condition</code> is a <code>FunctionalInterface</code>, how can I use Java 8 lambda to provide implementation <strong>in annotation</strong> rather than providing implementation.</p>
  
  <pre><code>@Conditional(value = MyCondition.class)
  
  class MyCondition implements Condition {
      @Override
      public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
          return ifMatches;
      }
  }
  </code></pre>