title: avoiding many if statements, code improvement
body: <p>I have oracle database that I can't change. In this db I have a user table with authority fields.</p>
  
  <pre><code>CREATE TABLE USER (
      ID NUMBER(38,0), 
      LOGIN VARCHAR2(6 BYTE) NOT NULL ENABLE, 
      PASSWORD VARCHAR2(200 BYTE) NOT NULL ENABLE, 
  
      BOOK_READ NUMBER(1,0), 
      BOOK_UPD NUMBER(1,0), 
      R_READ NUMBER(1,0), 
      R_UPD NUMBER(1,0), 
      ... 
      ...
  )
  </code></pre>
  
  <p>For example:</p>
  
  <pre><code>book_read = 1;  - means that user has authority 
  book_upd  = 0;  - means that user he does not
  report_read = 1;
  </code></pre>
  
  <p>Right now I am checking like this:</p>
  
  <pre><code>List&lt;GrantedAuthority&gt; authorities = new ArrayList&lt;GrantedAuthority&gt;();
  if (user.getBook_read() == 1) {
      authorities.add(new SimpleGrantedAuthority("ROLE_BOOK_READ"));
  }
  if (user.getBook_upd() == 1) {
      authorities.add(new SimpleGrantedAuthority("ROLE_BOOK_UPD"));
  }
  if (user.getReport_read() == 1) {
      authorities.add(new SimpleGrantedAuthority("ROLE_REPORT_READ"));
  }
  </code></pre>
  
  <p>I have a lot of Authorities (about 20, they all have a separate column in the table). Сan someone suggest how I can improve the code?</p>