title: Can a spring boot @RestController be enabled/disabled using properties?
body: <p>Given a "standard" spring boot application with a <code>@RestController</code>, eg</p>
  
  <pre><code>@RestController
  @RequestMapping(value = "foo", produces = "application/json;charset=UTF-8")
  public class MyController {
      @RequestMapping(value = "bar")
      public ResponseEntity&lt;String&gt; bar(
          return new ResponseEntity&lt;&gt;("Hello world", HttpStatus.OK);
      }
  }
  </code></pre>
  
  <p>Is there an annotation or technique that prevents the endpoint from starting <em>at all</em> if/unless a certain application property exists/doesn't exist.</p>
  
  <p>Note: Testing a property inside the method and exploding is not a solution, because the endpoint will exist.</p>
  
  <p>I don't care about the granularity: ie enabling/disabling just a method or the whole class are both fine.</p>
  
  <hr>
  
  <p>Because a profile is not a property, control via profiles does not solve my problem.</p>