class LiteralUtil {

  public static boolean toBoolean(final Literal literal, final String propertyName) {
    final String value = literal.getValue().toString();
    final boolean isTrue = value.equalsIgnoreCase("true");
    final boolean isFalse = value.equalsIgnoreCase("false");
    if (!isTrue && !isFalse) {
      throw new KsqlException("Property '" + propertyName + "' is not a boolean value");
    }
    return isTrue;
  }

  private  LiteralUtil();

}