We used to create our own pair classes to use in project. Now it's cool to have ready to use libs. Thank Techie
@gopisambasivarao52822 ай бұрын
Appreciate your efforts Basant! God Bless you!🙏👍
@manoganesan76182 ай бұрын
I have implemented this concept in one of our existing methods after watching your video. You are awesome!
@soto59872 ай бұрын
Please do not use this, the readability is so much lower. Multiple return values are a sign of too much responsibility or a lack of domain understanding. We create on purpose objects that hold values to communicate intend or coupling. In Go we use them to return value, error that is a totally different approach.
@abhiroopghatak94422 ай бұрын
*it is very useful but not for domain object ........but think it returns domainObject and possible exception object... and receiver will have either successful response from service or its internal exception which it need to refine more before showing to user. Pair
@smacdonald20122 ай бұрын
Return a list of POJOs. Another way to implement this. Like in all languages, different ways to perform such tasks.
@jaganathanmurthy68612 ай бұрын
Thanks buddy. Every time i got a notification from you , got curious to learn new thing to build my carrier growth.
@devaamujuri59982 ай бұрын
Hi Basant, I need some suggestion regarding one of the requirement. I need to reterieve the data one of the database table, it has morethan 3 lakhs records (for first time), 1. I need to call some 3rd party API for each rows and get some relavent details from API resonse and then I need to update same row with other 2 fields. So how we can handle entire thing in same request and wtih in same end point. (bascially retreive data, do same change in row, update same row for those many records). 2. This can be run on weekly batch. ( may be first time 3lakh records, later batch run it might be less), based on flag in DB column we can identify allread processed or not processed rows.
@Javatechie2 ай бұрын
Please drop an email to javatechie4u@gmail.com and elaborate your usecase little bit
@gouravkumar-or6jy2 ай бұрын
Thanks sir to share this knowledge 🙏, even though i used Pair class many times in my code.
@maheshwer0072 ай бұрын
We can use pojo class instead, which would be more cleaner and easy to understand approach, this approach creates confusion for new devs
@samsneera2 ай бұрын
How will this be useful if the number of objects to be returned are more than three? Considering readability and convenience, this feature looks good. As per my understanding, we can come up with our custom class containing these multiple records to be returned.
@saim72812 ай бұрын
Please do the video on remove duplicates in custom objects by using key using java stream api. Your videos are so boosting up my skills a lot.Thank you so much
@El_Espada2 ай бұрын
Kotlin has this feature and I find it awesome.
@MrKKPA2 ай бұрын
What might be the benefits of adding a library to do that when you can achieve the same by creating a object that contains the others nested objects?
@raghavanaliassaravananm15462 ай бұрын
Good Q. But you may not have a consistency of marking the objects as Left, Right or Middle. Of course Apache Commons Lang made the trend with this I suppose. In your custom classes, it would be more obvious to think of using a Map but that has its own variants.
@jrdillip2 ай бұрын
Thank You Basant Bhai, I was not aware about these fantastic classes. Thank you for sharing it, now I will try to use this in my project.
@Nilcha-22 ай бұрын
Though this makes it more object oriented, in the old days I use pass such object by reference to the method arguments. You can send back more than 3. Only it is mutable and open to side effects.
@saravanasathish4232 ай бұрын
This common lang3 will reduce writing multiple methods, thanks for the info ❤
@raghavanaliassaravananm15462 ай бұрын
Interesting Video. Thanks for sharing Basant.
@abhijitprusty2 ай бұрын
Awesome contents....
@phoenixjones08042 ай бұрын
Great content Basant bhai, next video tike kafka connect upare kara. Searched a lot but couldn't find anything useful with real life implementation. Jay Jagannath
@Javatechie2 ай бұрын
Okay noted Sritam ✅️.
@shankarraojujjuri94082 ай бұрын
nice information, I created custom pair class in my project, we will use this feature next onwards in my project
@rudrajitgupta36882 ай бұрын
This was awesome Basant..thank you for the learnings
@MurariKumar-wp6td2 ай бұрын
Thanks.. it is very useful for developers ❤👍
@abhuzaifa2 ай бұрын
@java techie please make a playlist on java 9,11 features
@phanimc112112 ай бұрын
thanks as always very resourceful
@mohammadtoficmohammad35942 ай бұрын
Thank you
@kanaillaurent5262 ай бұрын
Why not just return a record?
@inzi272 ай бұрын
what if you need to return multiple records?
@kanaillaurent5262 ай бұрын
@@inzi27 put your records into a single record. and return this single record.
@darogajee32862 ай бұрын
Can you explain with code
@magdel19402 ай бұрын
Same question.
@NaveenMovva2 ай бұрын
Nested records pattern is supported from java 21
@harichebrolu28172 ай бұрын
Useful concept
@BaluKompalli2 ай бұрын
Wow.... 🎉🎉🎉🎉🎉
@MilsonDev2 ай бұрын
Nice feature.
@kachoutmohamed94922 ай бұрын
Can use RECORD !?
@mohanlal86922 ай бұрын
It's a nice tutorial and great explanation. But instead of using this libraries we can achieve this using Generics by creating our own DTOs. just my thoughts....
@Javatechie2 ай бұрын
Yes we can create custom pojo but when library itself giving an easy option then why can't we choose that 😄
@sushant68152 ай бұрын
Great
@manishkeshari50962 ай бұрын
Thank you it's helpful ❤
@abhinetrakumar2 ай бұрын
Thank You Sir ❤❤
@rajkumarwinc93722 ай бұрын
Can we return more than 3 different objects..
@girishanker37962 ай бұрын
Great to know
@ErfanHossainShoaib2 ай бұрын
why use external lib for this public record Pair(X left, Y right){ public static Pair of(X x,Y y){ return new Pair(x,y); } }
@saichaithanyasaraf76342 ай бұрын
Why we need this when we have hashmap? @Javatechie
@MsPrettyg00d2 ай бұрын
❤
@ornelfranck2 ай бұрын
Nice
@theritesh9732 ай бұрын
❤❤❤
@rogerdinhelm46712 ай бұрын
I think y-glide is something that American comedians would add, imitating russian mobsters. Russians are more likely to just pronounce "ee" sound harder.
@sgr7ssАй бұрын
But it will create a tight coupling Not good for communication in Microservices!
@luisdanielmesa2 ай бұрын
Bad idea... return a record instead, or fix your design flaws. Or create a sealed interface and allow only the types you need. I have worked for Novell, IBM, Amazon and I'm currently at Oracle... don't do this unless you want to suffer trying to figure out what type you're returning.
@Javatechie2 ай бұрын
Why what complexity did you find In this approach. Just a simple example brother you have multiple upi payment method which one are you using? Just asking to help your question
@pardeepsaini38442 ай бұрын
🎉🎉🎉Yes Great Explanation.....
@saidineshbobbadhi83842 ай бұрын
Our wallpapers are same
@rishiraj25482 ай бұрын
🙂🙏🏻
@bhasoor2 ай бұрын
Some obsessive moron wants to give name to list....pair is logically a simple list with limitation on size... These methods are not for developers who are born and bought up in java.... These methods are specifically for people shifting to java from, i dont know which language... Honestly....These should not be part of standard java interview....if some interviewer asks this in interview.... understand that he is satisfying his ego...
@foddiebyage96962 ай бұрын
You have a great experience knowledge but lack of continuity in uploading leads to less reach