0

Is there any way to create a chain of method references like;

Chain chain = Product::getType::getTypeInfo::getTypeInfoId;

I want to create a generic null check method.

public Optional checkIfNull(Object object, Chain chain){
    return Optional.ofNullable(object).map(chain).isPresent();
}
hellzone
  • 5,393
  • 25
  • 82
  • 148

0 Answers0