title: JSON PII data masking in Java
body: <p>I would like to mask certain elements of JSON and print to logs. Masking can be either by substituting by dummy data or removing the key pair .Is there a utility to do the masking in Java ?</p>
  
  <p>E.g.,</p>
  
  <p>given JSON:</p>
  
  <pre><code>{
      "key1":"value1",
      "key2":"value2",
      "key3":"value3",
  }
  </code></pre>
  
  <p>mask key 2 alone and print JSON:</p>
  
  <pre><code>{
      "key1":"value1",
      "key2":"xxxxxx",
      "key3":"value3",
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{
      "key1":"value1",
      "key3":"value3",
  }
  </code></pre>