### Full Example: Object with All Annotation Types Source: https://context7.com/eltonsandre/mask-utils/llms.txt Demonstrates masking an object with simple fields, nested objects, and collections, both with and without groups. Shows how different annotations and groups affect the output. ```java import com.github.eltonsandre.maskutils.MaskUtils; import com.github.eltonsandre.maskutils.model.*; import java.util.Arrays; // Montagem do objeto completo Usuario usuario = Usuario.builder() .notMask("valorPublico") .username("mariasouza") .senha("s3nh@S3cr3t") .email("maria.souza@empresa.com") .cpf("321.321.321-45") .dataNascimento("1985-08-28") .endereco(Endereco.builder() .logradouro("R. rua A123") .numero("431") .cidade("São Paulo") .build()) .telefones(Arrays.asList( Telefone.builder() .ddi("55") .ddd("11") .numero("99876-5432") .build())) .build(); // ----- Sem grupo ----- MaskUtils.mask(usuario); // notMask → "valorPublico" (sem anotação, preservado) // username → "**********" // senha → "[SECRETO]" // email → "mari******@******.com" // cpf → "321.321.321-45" (namesGroup={"test"}, não afetado) // dataNascimento → "1985-08-28" (namesGroup={"test"}, não afetado) // endereco.logradouro → "*. *** ****" // endereco.numero → "***" // endereco.cidade → null (remove=true) // telefones[0].ddi → "**" // telefones[0].ddd → "**" // telefones[0].numero → null (remove=true, sem grupo) System.out.println(usuario); // ----- Com grupo "test" ----- Usuario usuario2 = /* nova instância com os mesmos dados */ buildUsuario(); MaskUtils.mask(usuario2, "test"); // cpf → "321.***.***-**" // email → "mari******@******" // dataNascimento → "**/**/1985" // telefones[0].numero → "998-****-****" System.out.println(usuario2); ``` -------------------------------- ### Masking Fields in Cliente Class Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Demonstrates how to use @MaskField and @MaskGroups annotations to mask sensitive fields like CPF, email, and birth date. The CPF is masked to show only the first 3 characters, email is partially masked, and birth date is masked to show only the day. ```java public class Cliente { private String nome; @MaskField(regex = "(^[^@]{3}).*", replacement = "$1.***.***-**", namesGroup = {"dado.pii"}) private String cpf; @MaskGroups({ @MaskField(regex = "(^[^@]{4}).*@[^.]*(\\..*)", replacement = "$1******@****$2"), @MaskField(regex = "(^[^@]{4}).*@[^.]*(\\..*)", replacement = "$1******@******", namesGroup = {"dado.pci"}) }) private String email; @MaskField(regex = "(^[^@]{4}).*", replacement = "**/**/$1", namesGroup = {"dado.pii"}) private String dataNascimento; @MaskCollectonData private List telefones; @MaskObjectData private Endereco endereco; } ``` -------------------------------- ### Add mask-utils Dependency to Gradle Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Include the mask-utils library in your Gradle project by adding the implementation dependency. ```groovy //build.gradle dependencies { implementation 'com.github.eltonsandre.utils:mask-utils:1.0.1' } ``` -------------------------------- ### Masking Email with and without Group Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Demonstrates masking an email field using MaskUtils.mask(), either with a default group or by explicitly passing a group name like 'dado.pii'. ```java class ExemploParaGrupo { public Cliente mascarar(final Cliente cliente, final boolean semGrupo) { cliente.setEmail("test.mask@mock.com"); if (semGrupo) { /*default sem grupo*/ return MaskUtils.mask(cliente); // resultado: email=test******@****.com } /*Passando grupo*/ return MaskUtils.mask(cliente, "dado.pii"); // resultado: email=test******@****** } } ``` -------------------------------- ### Mask Credit Card Data for PCI Group Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Create a CartaoCredito object and use MaskUtils.mask() with the 'dado.pci' group to mask sensitive fields according to their annotations. ```java public class ExemploCard { public Cartao mask() { Cartao cartao = Cartao.builder() .nome("John Connor") .cvv("123") .numero("5498 0305 8674 0032") .anoValidade("2030") .mesValidade("12") .build(); return MaskUtils.mask(cartao, "dado.pci"); } ``` ``` Resultado: Cartao( nome=John Connor, numero=5498 **** **** 0032, cvv=***, anoValidade=****, mesValidade=** ) ``` ``` -------------------------------- ### Add mask-utils Dependency to Maven Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Include the mask-utils library in your Maven project by adding the dependency to your pom.xml. ```xml //pom.xml com.github.eltonsandre.utils mask-utils 1.0.1 ``` -------------------------------- ### MaskUtils.maskClone(T obj) Source: https://context7.com/eltonsandre/mask-utils/llms.txt Masks a clone of the object, leaving the original object intact. It attempts to clone the object using Apache Commons' ObjectUtils.cloneIfPossible. ```APIDOC ## MaskUtils.maskClone(T obj) ### Description Masks a copy of the object, preserving the original object intact. It attempts to clone the original object (via Apache Commons' ObjectUtils.cloneIfPossible) and applies group-less masking to the copy. ### Method ```java public static T maskClone(T obj) ``` ### Parameters #### Path Parameters - **obj** (T) - Required - The object to be cloned and masked. ### Request Example ```java import com.github.eltonsandre.maskutils.MaskUtils; Usuario original = Usuario.builder() .username("adminuser") .senha("P@ssw0rd!") .email("admin@empresa.com") .build(); // The 'original' object is not modified Object mascarado = MaskUtils.maskClone(original); System.out.println(original.getSenha()); // "P@ssw0rd!" (intact) System.out.println(((Usuario) mascarado).getSenha()); // "[SECRETO]" (masked copy) ``` ### Response #### Success Response (T) - A new object of type T, which is a masked clone of the original object. ``` -------------------------------- ### Masking Fields in Telefone Class Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Shows how to mask phone number fields using @MaskField and @MaskGroups. The 'numero' field is configured to be removed entirely by default, but can be masked to show only the first 3 characters followed by asterisks when associated with the 'dado.pii' group. ```java @Data public class Telefone { @MaskField private String ddi; @MaskField private String ddd; @MaskGroups({ @MaskField(remove = true), @MaskField(regex = "(^[^@]{3}).*", replacement = "$1******@******", namesGroup = {"dado.pii"}) }) private String numero; } ``` -------------------------------- ### Masking a Cloned Object Source: https://context7.com/eltonsandre/mask-utils/llms.txt Clones the original object and applies general masking (without a group) to the copy, leaving the original object unchanged. This is useful when the original object must be preserved. ```java import com.github.eltonsandre.maskutils.MaskUtils; Usuario original = Usuario.builder() .username("adminuser") .senha("P@ssw0rd!") .email("admin@empresa.com") .build(); // O objeto 'original' não é modificado Object mascarado = MaskUtils.maskClone(original); System.out.println(original.getSenha()); // "P@ssw0rd!" (intacto) System.out.println(((Usuario) mascarado).getSenha()); // "[SECRETO]" (cópia mascarada) ``` -------------------------------- ### Define PCI DSS Card Data Masking Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Annotate sensitive fields of a CreditCard object with @MaskField and specify the 'dado.pci' group for masking sensitive card details like number, CVV, and expiry. ```java @Data public class CartaoCredito { private String nome; @MaskField(regex = "^([0-9]{4})(.*)([0-9]{4})", replacement = "$1 **** **** $3", namesGroup = {"dado.pci"}) private String numero; @MaskField(namesGroup = {"dado.pci"}) private String cvv; @MaskField(namesGroup = {"dado.pci"}) private String anoValidade; @MaskField(namesGroup = {"dado.pci"}) private String mesValidade; } ``` -------------------------------- ### Mask PII Field with Regex Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Use the @MaskField annotation to mask a String field like CPF using a regex and replacement pattern for a specific group. ```java public class Cliente { ... @MaskField(regex = "(^[^@]{3}).*", replacement = "$1.***.***-**", namesGroup = {"dado.pii"}) private String cpf; ... } ``` -------------------------------- ### Define Sensitive Credential Masking Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Annotate a Usuario object's fields for masking. Use @MaskField for password with a specific replacement and @MaskGroups for email with different rules. ```java @Data public class Usuario { @MaskField private String username; @MaskGroups({ @MaskField(regex = "(^[^@]{4}).*@[^.]*(\\..*)", replacement = "$1******@****$2"), @MaskField(regex = "(^[^@]{4}).*@[^.]*(\\..*)", replacement = "$1******@******", namesGroup = {"dado.pii"}) }) private String email; @MaskField(regex = "^.*", replacement = "[SECRETO]", namesGroup = {"dado.sensivel"}) private String password; } ``` -------------------------------- ### In-place Object Masking without Grouping using MaskUtils.mask(T obj) Source: https://context7.com/eltonsandre/mask-utils/llms.txt Apply all non-grouped masking annotations directly to the provided object, modifying it in-place. This method does not create a copy of the object. ```java import com.github.eltonsandre.maskutils.MaskUtils; Usuario usuario = Usuario.builder() .username("joaosilva") .senha("s3nh@S3cr3t") .email("joao.silva@empresa.com") .cpf("321.321.321-45") .build(); MaskUtils.mask(usuario); // username → "**********" (sem namesGroup, afetado por padrão) // senha → "[SECRETO]" (regex ".*", sem namesGroup) // email → "joao******@******.com" (MaskGroups sem namesGroup) // cpf → "321.321.321-45" (tem namesGroup={"test"}, não afetado) System.out.println(usuario); ``` -------------------------------- ### `MaskUtils.mask(T obj)` Method Source: https://context7.com/eltonsandre/mask-utils/llms.txt This method applies all non-grouped masking annotations (fields with empty `namesGroup`) directly to the provided object, modifying it in-place. It does not create a copy of the object. ```APIDOC ## API Principal — `MaskUtils` ### `MaskUtils.mask(T obj)` — Ofusca in-place sem grupo Aplica todas as anotações de mascaramento sem grupo definido (campos com `namesGroup` vazio) diretamente no objeto passado, modificando-o in-place. Não cria cópia do objeto. ```java import com.github.eltonsandre.maskutils.MaskUtils; Usuario usuario = Usuario.builder() .username("joaosilva") .senha("s3nh@S3cr3t") .email("joao.silva@empresa.com") .cpf("321.321.321-45") .build(); MaskUtils.mask(usuario); // username → "**********" (sem namesGroup, afetado por padrão) // senha → "[SECRETO]" (regex "^.*", sem namesGroup) // email → "joao******@******.com" (MaskGroups sem namesGroup) // cpf → "321.321.321-45" (tem namesGroup={"test"}, não afetado) System.out.println(usuario); ``` ``` -------------------------------- ### In-place Masking with Group Source: https://context7.com/eltonsandre/mask-utils/llms.txt Applies masking annotations with a specified group to the object in-place. Fields without a corresponding group are not altered. Returns the modified object. ```java import com.github.eltonsandre.maskutils.MaskUtils; Cartao cartao = Cartao.builder() .nome("John Connor") .numero("5498 0305 8674 0032") .cvv("123") .anoValidade("2030") .mesValidade("12") .build(); // Aplica somente campos com namesGroup = {"dado.pci"} Cartao mascarado = (Cartao) MaskUtils.mask(cartao, "dado.pci"); System.out.println(mascarado.getNome()); // "John Connor" (sem anotação) System.out.println(mascarado.getNumero()); // "5498 **** **** 0032" System.out.println(mascarado.getCvv()); // "***" System.out.println(mascarado.getAnoValidade()); // "****" System.out.println(mascarado.getMesValidade()); // "**" ``` -------------------------------- ### MaskUtils.mask(T object) Source: https://context7.com/eltonsandre/mask-utils/llms.txt Applies masking annotations without a specific group to an object in-place. This is a convenience method for applying default masking rules. ```APIDOC ## MaskUtils.mask(T object) ### Description Applies masking annotations without a specific group to the object in-place. Fields without a `namesGroup` corresponding to the group informed (or if no group is informed) are not altered. Returns the modified object itself. ### Method ```java public static T mask(T object) ``` ### Parameters #### Path Parameters - **object** (T) - Required - The object to be masked. ### Request Example ```java import com.github.eltonsandre.maskutils.MaskUtils; // Example demonstrating masking without a group Usuario usuario = Usuario.builder() .notMask("valorPublico") .username("mariasouza") .senha("s3nh@S3cr3t") .email("maria.souza@empresa.com") .build(); MaskUtils.mask(usuario); // notMask → "valorPublico" (no annotation, preserved) // username → "**********" // senha → "[SECRETO]" // email → "mari******@******.com" System.out.println(usuario); ``` ### Response #### Success Response (T) - The masked object of type T. ``` -------------------------------- ### Apply Multiple Masking Rules to an Email Field Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Use @MaskGroups to define multiple @MaskField annotations for a single field, allowing different masking rules based on whether a group is specified. ```java public class Cliente { @MaskGroups({ @MaskField(regex = "(^[^@]{4}).*@[^.]*(\\..*)", replacement = "$1******@****$2"), @MaskField(regex = "(^[^@]{4}).*@[^.]*(\\..*)", replacement = "$1******@******", namesGroup = {"dado.pci"}) }) private String email; ... } ``` -------------------------------- ### Grouping Multiple Masks with @MaskGroups Source: https://context7.com/eltonsandre/mask-utils/llms.txt Use @MaskGroups to apply different @MaskField rules to the same field based on specified group names. The first @MaskField without a namesGroup is applied when no group is active. ```java import com.github.eltonsandre.maskutils.annotations.MaskField; import com.github.eltonsandre.maskutils.annotations.MaskGroups; import lombok.Data; @Data public class Cliente { // Sem grupo ativo: "test.mask@mock.com" → "test******@****.com" // Com grupo "dado.pci": "test.mask@mock.com" → "test******@******" @MaskGroups({ @MaskField( regex = "(^[^@]{4}).*@[^.]*(\\..+)", replacement = "$1******@****$2" ), @MaskField( regex = "(^[^@]{4}).*@[^.]*(\\..+)", replacement = "$1******@******", namesGroup = {"dado.pci"} ) }) private String email; } // Uso: Cliente cliente = new Cliente(); cliente.setEmail("test.mask@mock.com"); // Sem grupo — aplica o primeiro @MaskField (sem namesGroup) MaskUtils.mask(cliente); System.out.println(cliente.getEmail()); // "test******@****.com" // Com grupo "dado.pci" — aplica o segundo @MaskField MaskUtils.mask(cliente, "dado.pci"); System.out.println(cliente.getEmail()); // "test******@******" ``` -------------------------------- ### Mask Fields in Collections of Objects with @MaskCollectonData Source: https://context7.com/eltonsandre/mask-utils/llms.txt Apply `@MaskCollectonData` to a `Collection` field to iterate over each element and apply mask annotations found in the fields of each item. This allows masking lists of objects without manual iteration. ```java import com.github.eltonsandre.maskutils.annotations.MaskCollectonData; import com.github.eltonsandre.maskutils.annotations.MaskField; import com.github.eltonsandre.maskutils.annotations.MaskGroups; import lombok.Data; import java.util.List; @Data public class Telefone { @MaskField private String ddi; @MaskField private String ddd; // Sem grupo: remove o número (null); com grupo "test": mascara parcialmente @MaskGroups({ @MaskField(remove = true), @MaskField( regex = "(^[^@]{3}).*", replacement = "$1-****-****", namesGroup = {"test"} ) }) private String numero; } @Data public class Contato { private String nome; @MaskCollectonData // itera a lista e ofusca campos de cada Telefone private List telefones; } // Uso: Telefone tel = new Telefone(); tel.setDdi("55"); tel.setDdd("11"); tel.setNumero("99876-5432"); Contato contato = new Contato(); contato.setNome("Maria"); contato.setTelefones(List.of(tel)); // Sem grupo MaskUtils.mask(contato); System.out.println(contato.getTelefones().get(0).getDdi()); // "**" System.out.println(contato.getTelefones().get(0).getDdd()); // "**" System.out.println(contato.getTelefones().get(0).getNumero()); // null (remove=true) // Com grupo "test" MaskUtils.mask(contato, "test"); System.out.println(contato.getTelefones().get(0).getNumero()); // "998-****-****" ``` -------------------------------- ### `@MaskCollectonData` Annotation Source: https://context7.com/eltonsandre/mask-utils/llms.txt Marks an attribute of type `Collection` (e.g., `List`, `Set`) for masking. The library iterates over each element in the collection and applies masking annotations found in the fields of each item. This allows for obfuscating lists of objects without manual iteration. ```APIDOC ## `@MaskCollectonData` — Ofusca campos em coleções de objetos Marca um atributo do tipo `Collection` (ex.: `List`, `Set`) para que a biblioteca itere sobre cada elemento e aplique as anotações de máscara encontradas nos campos de cada item da coleção. Permite ofuscar listas de objetos sem iteração manual. ```java import com.github.eltonsandre.maskutils.annotations.MaskCollectonData; import com.github.eltonsandre.maskutils.annotations.MaskField; import com.github.eltonsandre.maskutils.annotations.MaskGroups; import lombok.Data; import java.util.List; @Data public class Telefone { @MaskField private String ddi; @MaskField private String ddd; // Sem grupo: remove o número (null); com grupo "test": mascara parcialmente @MaskGroups({ @MaskField(remove = true), @MaskField( regex = "(^[^@]{3}).*", replacement = "$1-****-****", namesGroup = {"test"} ) }) private String numero; } @Data public class Contato { private String nome; @MaskCollectonData // itera a lista e ofusca campos de cada Telefone private List telefones; } // Uso: Telefone tel = new Telefone(); tel.setDdi("55"); tel.setDdd("11"); tel.setNumero("99876-5432"); Contato contato = new Contato(); contato.setNome("Maria"); contato.setTelefones(List.of(tel)); // Sem grupo MaskUtils.mask(contato); System.out.println(contato.getTelefones().get(0).getDdi()); // "**" System.out.println(contato.getTelefones().get(0).getDdd()); // "**" System.out.println(contato.getTelefones().get(0).getNumero()); // null (remove=true) // Com grupo "test" MaskUtils.mask(contato, "test"); System.out.println(contato.getTelefones().get(0).getNumero()); // "998-****-****" ``` ``` -------------------------------- ### Annotating Fields with @MaskField Source: https://context7.com/eltonsandre/mask-utils/llms.txt Use the @MaskField annotation to define masking rules for String fields. It supports regex-based replacement, nullification (remove=true), and group-specific masking via namesGroup. When used without parameters, it masks each character with '*'. ```java import com.github.eltonsandre.maskutils.annotations.MaskField; import lombok.Data; @Data public class Usuario { // Sem parâmetros: substitui cada caractere por '*' @MaskField private String username; // Substitui todo o conteúdo pelo texto literal "[SECRETO]" @MaskField(regex = "^.*", replacement = "[SECRETO]") private String senha; // Aplica máscara apenas quando o grupo "dado.pii" for solicitado // Mantém os 3 primeiros caracteres e oculta o restante no formato CPF @MaskField(regex = "(^[^@]{3}).*", replacement = "$1.***.***-**", namesGroup = {"dado.pii"}) private String cpf; // Remove o campo (seta null) sem restrição de grupo @MaskField(remove = true) private String cidade; } // Uso: Usuario usuario = new Usuario(); usuario.setUsername("joaosilva"); usuario.setSenha("s3nh@S3cr3t"); usuario.setCpf("321.321.321-45"); // Aplica sem grupo (campos sem namesGroup definido são afetados) MaskUtils.mask(usuario); // username => "**********" (cada char substituído por *) // senha => "[SECRETO]" // cpf => não mascarado (tem namesGroup definido, nenhum grupo ativo) // Aplica com grupo "dado.pii" MaskUtils.mask(usuario, "dado.pii"); // cpf => "321.***.***-**" ``` -------------------------------- ### MaskUtils.mask(T object, String group) Source: https://context7.com/eltonsandre/mask-utils/llms.txt Applies masking annotations with a specified group to an object in-place. Fields without a corresponding group are not altered. The modified object is returned. ```APIDOC ## MaskUtils.mask(T object, String group) ### Description Applies masking annotations that have the specified group to the `namesGroup`. Fields without a `namesGroup` corresponding to the informed group are not altered. Returns the modified object itself. ### Method ```java public static T mask(T object, String group) ``` ### Parameters #### Path Parameters - **object** (T) - Required - The object to be masked. - **group** (String) - Required - The group name for applying masking annotations. ### Request Example ```java import com.github.eltonsandre.maskutils.MaskUtils; Cartao cartao = Cartao.builder() .nome("John Connor") .numero("5498 0305 8674 0032") .cvv("123") .anoValidade("2030") .mesValidade("12") .build(); // Apply only fields with namesGroup = {"dado.pci"} Cartao mascarado = (Cartao) MaskUtils.mask(cartao, "dado.pci"); System.out.println(mascarado.getNome()); // "John Connor" (no annotation) System.out.println(mascarado.getNumero()); // "5498 **** **** 0032" System.out.println(mascarado.getCvv()); // "***" System.out.println(mascarado.getAnoValidade()); // "****" System.out.println(mascarado.getMesValidade()); // "**" ``` ### Response #### Success Response (T) - The masked object of type T. ``` -------------------------------- ### Recursively Mask Nested Object Fields with @MaskObjectData Source: https://context7.com/eltonsandre/mask-utils/llms.txt Use `@MaskObjectData` on an object field to recursively apply mask annotations to its fields. This is essential for masking composed entities. ```java import com.github.eltonsandre.maskutils.annotations.MaskField; import com.github.eltonsandre.maskutils.annotations.MaskObjectData; import lombok.Data; @Data public class Endereco { @MaskField(regex = "\\w") // substitui cada caractere alfanumérico por '*' private String logradouro; @MaskField // substitui cada caractere por '*' private String numero; @MaskField(remove = true) // remove o valor (seta null) private String cidade; } @Data public class Pedido { private String id; @MaskObjectData // entra recursivamente em Endereco e ofusca seus campos private Endereco enderecoEntrega; } // Uso: Endereco endereco = new Endereco(); endereco.setLogradouro("R. rua A123"); endereco.setNumero("431"); endereco.setCidade("São Paulo"); Pedido pedido = new Pedido(); pedido.setId("PED-001"); pedido.setEnderecoEntrega(endereco); MaskUtils.mask(pedido); System.out.println(pedido.getEnderecoEntrega().getLogradouro()); // ".* *** ****" System.out.println(pedido.getEnderecoEntrega().getNumero()); // "***" System.out.println(pedido.getEnderecoEntrega().getCidade()); // null ``` -------------------------------- ### `@MaskObjectData` Annotation Source: https://context7.com/eltonsandre/mask-utils/llms.txt Marks an attribute of an object type for recursive masking. This annotation allows the library to enter nested objects and apply masking annotations found within their fields, which is essential for obfuscating composite entities. ```APIDOC ## `@MaskObjectData` — Ofusca campos de objetos complexos aninhados Marca um atributo cujo tipo é outro objeto (não primitivo, não coleção) para que a biblioteca entre recursivamente nesse objeto e aplique as anotações de máscara encontradas em seus campos. Essencial para ofuscar entidades compostas. ```java import com.github.eltonsandre.maskutils.annotations.MaskField; import com.github.eltonsandre.maskutils.annotations.MaskObjectData; import lombok.Data; @Data public class Endereco { @MaskField(regex = "\\w") // substitui cada caractere alfanumérico por '*' private String logradouro; @MaskField // substitui cada caractere por '*' private String numero; @MaskField(remove = true) // remove o valor (seta null) private String cidade; } @Data public class Pedido { private String id; @MaskObjectData // entra recursivamente em Endereco e ofusca seus campos private Endereco enderecoEntrega; } // Uso: Endereco endereco = new Endereco(); endereco.setLogradouro("R. rua A123"); endereco.setNumero("431"); endereco.setCidade("São Paulo"); Pedido pedido = new Pedido(); pedido.setId("PED-001"); pedido.setEnderecoEntrega(endereco); MaskUtils.mask(pedido); System.out.println(pedido.getEnderecoEntrega().getLogradouro()); // "*. *** ****" System.out.println(pedido.getEnderecoEntrega().getNumero()); // "***" System.out.println(pedido.getEnderecoEntrega().getCidade()); // null ``` ``` -------------------------------- ### Mask Object Data for a Specific Group Source: https://github.com/eltonsandre/mask-utils/blob/master/README.md Utilize MaskUtils.mask() to apply masking to an object based on the specified group name, processing fields annotated with @MaskField for that group. ```java public class Cliente { public Cliente recuperaDadosCliente(final String id) { //codigo ... final Cliente clienteOfuscado = (Cliente) MaskUtils.mask(cliente, "dado.pii"); //codigo ... return clienteOfuscado; } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.