5

I am new in Java 8, and I have this expression:

 .map(mc -> mc.getName().getDefaultName())

and I would like to know if it could be replaced for something like:

.map(TeleBadalonaCampaignType::getName::getDefaultName)
1
  • Please use correct upper case letters in title. Commented Jul 28, 2019 at 21:36

1 Answer 1

6

nope, not really - the language has no such construct; unless you map it twice:

.map(TeleBadalonaCampaignType::getName)
.map(WhateverObject::getDefaultName)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.