Creating custom cache key from method object properties using SpEL

In this post under Spring Caching, I will show with example how to create custom cache key using annotated method’s properties in SpEL. For our example, we will use the below “Calculator” class as shown below Calculator package caching.package7; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; @Component public class Calculator { @Cacheable(cacheNames = "addNumbersWithParam_region", key = "#root.method.hashCode() +…… Continue reading Creating custom cache key from method object properties using SpEL

Side masking of delimited text with configured delimiter

In this post under DataMask, I will show with example how to do side masking of a simple delimited text excluding masking of delimiter. So if the text is “1111-2222-3333-4444”, the output should be “***1-2222-33**-***” As you can see from the output the numbers are masked from the sides excluding delimiters. Below is the complete…… Continue reading Side masking of delimited text with configured delimiter