RepeatCharacterRegexRule example

In this post under Passay, I will explain with example the purpose of “RepeatCharacterRegexRule” rule. This rule checks the user inputed password for repeated ASCII characters. If a particular ASCII character is repeated more than the preconfigured character count, the rule will invalidate the password. Let’s say, the pre-configured character count is 3, and below…… Continue reading RepeatCharacterRegexRule example

BeanFactoryPostProcessor example

In this post under Spring Core, I will explain with example the purpose of “BeanFactoryPostProcessor” Spring class. We define our Spring beans and give it to Spring container to create instances of those beans. Spring container reads the bean definitions and create instances of beans. What if we want to change the definition of those…… Continue reading BeanFactoryPostProcessor example

Passing the target type to custom mapper

In previous post under MapStruct, I showed how to create a custom mapper method and how MapStruct framework calls it. For recap,1) sometimes we cannot depend on the mapping method created by MapStruct. So we create our own custom mapper method which takes care of mapping one object properties to another object properties.2) We instruct…… Continue reading Passing the target type to custom mapper

Implementing instance factory method using Spring annotations

In this post under Spring Core, I will show how to implement instance factory method using Spring annotations instead of using xml approach. For our example, lets create “Calculator” class with below structure, whose bean we have to create using instance factory method Calculator package core.package53; public class Calculator { public void calculate() { System.out.println(“Calculating….”);…… Continue reading Implementing instance factory method using Spring annotations

Implementing static factory method using Spring annotations

In this post under Spring Core, I will show how to implement static factory method using Spring annotations instead of using xml approach. For our example, lets create “Calculator” class with below structure, whose bean we have to create using factory method Calculator package core.package52; public class Calculator { public void calculate() { System.out.println(“Calculating….”); }…… Continue reading Implementing static factory method using Spring annotations

IllegalSequenceRule with custom character sequences example 2

In previous post under Passay, I showed one example of how to use “IllegalSequenceRule” with custom character sequences. This post is continuation of the previous post with another example. In the previous post, I used different two custom character sequences, one character sequence containing only numbers and another character sequence containing only alphabets. In this…… Continue reading IllegalSequenceRule with custom character sequences example 2

IllegalSequenceRule with custom character sequences example 1

In previous post under Passay, I showed with example the purpose of “IllegalSequenceRule”. For recap, this rule makes sure that the password doesn’t contain the given character sequence, for example “qwerty” character sequence. So if the password is “qwerty” or “sam_qwerty_@”, the validation will fail but if the password is “aabb”, the validation passes. When…… Continue reading IllegalSequenceRule with custom character sequences example 1

CollectionUtils selectRejected method

In this post under Apache Collections, I will show with example the use of “selectRejected” method. “selectRejected” is a static method available under “CollectionUtils” class. It takes two arguments1) input collection2) predicate In this method, the predicate is evaluated on each item of the collection and a new collection is returned which contains items from…… Continue reading CollectionUtils selectRejected method

Using @Lookup on method with its local and instance arguments

In my previous post under Spring Core, I have explained the use of “@Lookup” annotation and how to use it with or without its arguments. In this post, I will show with example, how we can use “@Lookup” (with or without its argument) with a method that takes a local variable and instance variable as…… Continue reading Using @Lookup on method with its local and instance arguments