title: convert from boolean to byte in java
body: <p>I need to set byte value as method parameter. I have boolean variable <code>isGenerated</code>, that determines the logic to be executed within this method. But I can pass directly boolean as byte parameter this is not allowed and can't be cast in java. So the solution I have now looks like this:</p>
  
  <pre><code>myObj.setIsVisible(isGenerated ? (byte)1 : (byte)0);
  </code></pre>
  
  <p>But it seems odd for me. Maybe some better solution exists to do this?</p>