title: String 'Y' to true and 'N' to false in Java
body: <p>Is there any library in Java to convert a string "Y" to true or "N" to false?</p>
  
  <p>I did an enum but I don't know if it is the best way:</p>
  
  <pre><code>public enum BooleanEnum {
  
      TRUE("Y"), FALSE("F");
  
      private String booleanValue;
  
      private BooleanEnum(String booleanValue) {
          this.booleanValue = booleanValue;
      }
  
      public String getBooleanValue() {
          return booleanValue;
      }
  
  }
  </code></pre>
  
  <p>And to use:</p>
  
  <pre><code>if (BooleanEnum.TRUE.getBooleanValue().equals(cpoPipelineDTO.getCpoPipelineCategory().getIsDataFlow())) {
  </code></pre>