title
Functional Programming in Java - Full Course
description
Learn all about Functional Programming in Java with this full tutorial course for beginners. Functional programming will help you reduce and simplify your code.
You will learn the power of Java Functional Interfaces and how they can be used to create powerful statements and design patterns. You will also learn how to write declarative code by combining Functional Interfaces with Streams.
Skills covered:
• Java
• Functional Programming
• Combinator Design Pattern
• Optionals
• Streams
💻 Code: https://github.com/amigoscode/java-functional-programming
🎥 Course from Amingoscode. Subscribe to the Amigoscode YouTube channel: http://bit.ly/2HpF5V8
⭐️ Course Contents ⭐️
⌨️ (00:00:00) Intro
⌨️ (00:02:54) Quick word before we begin
⌨️ (00:03:36) Bootstrapping Application
⌨️ (00:06:31) Imperative Approach
⌨️ (00:13:30) Declarative Approach
⌨️ (00:19:14) Java Util Function Package
⌨️ (00:22:55) Function
⌨️ (00:36:03) BiFunction
⌨️ (00:43:10) Consumer
⌨️ (00:48:13) BiConsumer
⌨️ (00:52:09) Predicate
⌨️ (01:02:08) Supplier
⌨️ (01:06:55) Let me say something
⌨️ (01:07:29) Intro to Java Streams
⌨️ (01:19:23) More on Java Streams
⌨️ (01:23:52) Java Optionals
⌨️ (01:31:19) Combinator Pattern
⌨️ (01:40:28) Implementing Combinator Pattern
⌨️ (01:55:34) Callbacks Like Javascript
⌨️ (02:05:08) Lambdas
⌨️ (02:11:37) Primitives
⌨️ (02:15:29) Properties of Functional Programming
⌨️ (02:20:25) Let's wrap it up
⭐️ Links ⭐️
🔗 Full course also available here: https://amigoscode.com/courses/java-functional-programming
🔗 Join Closed Facebook Group for discussion and early access videos and courses: http://bit.ly/2FbuIkx
🔗 Follow Amigoscode on Instagram: http://bit.ly/2TSkA9w
--
Learn to code for free and get a developer job: https://www.freecodecamp.org
Read hundreds of articles on programming: https://freecodecamp.org/news
detail
{'title': 'Functional Programming in Java - Full Course', 'heatmap': [{'end': 602.217, 'start': 504.749, 'weight': 1}, {'end': 4681.744, 'start': 4596.127, 'weight': 0.803}, {'end': 6643.534, 'start': 6381.132, 'weight': 0.827}], 'summary': 'The full course on functional programming in java covers imperative vs. declarative programming, functional interfaces, combinator design pattern, streams, optionals, lambdas, callbacks, and properties of functional programming. it emphasizes practice and setting up intellij for java back end development, showcasing practical usage of bi-function, predicates, consumers, logical operators, supplier functional interface, java streams, and the combinator design pattern. the course also explains the implementation of the combinator pattern for customer validation and the benefits of combining functional interfaces with normal functions, usage of lambdas, and rules of functional programming.', 'chapters': [{'end': 387.902, 'segs': [{'end': 135.428, 'src': 'embed', 'start': 69.579, 'weight': 0, 'content': [{'end': 80.384, 'text': "I'm going to teach you exactly what the differences are between imperative and declarative programming and why you want to move away from imperative programming.", 'start': 69.579, 'duration': 10.805}, {'end': 85.087, 'text': "Then I'm going to teach you about the functional interfaces that Java has to provide.", 'start': 80.984, 'duration': 4.103}, {'end': 89.429, 'text': 'So functions, by functions, predicates, consumers, suppliers.', 'start': 85.187, 'duration': 4.242}, {'end': 99.5, 'text': 'and all that good stuff, right? So once you learn that, you can then start to use streams and optionals to write code in a declarative way.', 'start': 90.229, 'duration': 9.271}, {'end': 105.468, 'text': "And then, towards the end, I'm going to teach you one of my favorite design patterns when it comes to functional programming,", 'start': 99.921, 'duration': 5.547}, {'end': 110.251, 'text': 'And that is the combinator design pattern, which is really really awesome.', 'start': 105.808, 'duration': 4.443}, {'end': 116.215, 'text': "It's really good for validation where you simply define all of your validations in an interface.", 'start': 110.771, 'duration': 5.444}, {'end': 121.078, 'text': 'And then you define exactly step by step what you want your validation to be.', 'start': 116.595, 'duration': 4.483}, {'end': 122.539, 'text': "It's really, really awesome.", 'start': 121.438, 'duration': 1.101}, {'end': 131.025, 'text': "And finally, I'm also going to teach you exactly about lambdas, callbacks and the properties of functional programming,", 'start': 123.06, 'duration': 7.965}, {'end': 135.428, 'text': 'so that you fully grasp exactly the whole concept.', 'start': 131.025, 'duration': 4.403}], 'summary': 'Teaching imperative vs declarative programming, functional interfaces, streams, optionals, and combinator design pattern in java.', 'duration': 65.849, 'max_score': 69.579, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI69579.jpg'}, {'end': 189.376, 'src': 'embed', 'start': 166.114, 'weight': 5, 'content': [{'end': 173.616, 'text': "So what I want from you is to go ahead and practice as I teach, because that's the best way for you to learn any new technology.", 'start': 166.114, 'duration': 7.502}, {'end': 177.037, 'text': 'Also, go ahead and join the private Facebook group.', 'start': 174.457, 'duration': 2.58}, {'end': 180.879, 'text': 'So if you have any questions, you can go ahead and engage with other students.', 'start': 177.097, 'duration': 3.782}, {'end': 184.1, 'text': 'And the group is full of cool people just like you.', 'start': 181.139, 'duration': 2.961}, {'end': 187.494, 'text': 'So this is all I wanted to say for now.', 'start': 185.191, 'duration': 2.303}, {'end': 189.376, 'text': 'And enough of me talking.', 'start': 188.215, 'duration': 1.161}], 'summary': 'Practice as taught to learn new technology, join private facebook group for questions and engagement.', 'duration': 23.262, 'max_score': 166.114, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI166114.jpg'}, {'end': 249.339, 'src': 'embed', 'start': 221.241, 'weight': 6, 'content': [{'end': 230.146, 'text': 'And to be honest, as a software engineer, this is probably the idea of your choice when it comes to Java back end development.', 'start': 221.241, 'duration': 8.905}, {'end': 232.747, 'text': 'So let me go back to IntelliJ.', 'start': 230.846, 'duration': 1.901}, {'end': 236.409, 'text': "And the first thing I'm going to do is to create a project.", 'start': 233.528, 'duration': 2.881}, {'end': 239.351, 'text': "And right here I'm going to pick Maven.", 'start': 237.43, 'duration': 1.921}, {'end': 249.339, 'text': "Now the project SDK, it doesn't really matter whether you use Java 11, 12 or any other version as long as is above 1.7.", 'start': 240.151, 'duration': 9.188}], 'summary': 'Java back end development in intellij using maven, sdk above 1.7.', 'duration': 28.098, 'max_score': 221.241, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI221241.jpg'}], 'start': 10.023, 'title': 'Functional programming with java', 'summary': 'Covers the concept of functional programming with java, including differences between imperative and declarative programming, functional interfaces, combinator design pattern, streams, optionals, lambdas, callbacks, and properties of functional programming. it also emphasizes the importance of practice, setting up intellij for java back end development, and engaging with other students in the private facebook group.', 'chapters': [{'end': 135.428, 'start': 10.023, 'title': 'Functional programming with java', 'summary': 'Introduces the concept of functional programming with java, explaining the differences between imperative and declarative programming, the functional interfaces provided by java, and the combinator design pattern, along with the use of streams, optionals, lambdas, callbacks, and properties of functional programming.', 'duration': 125.405, 'highlights': ['The chapter covers the differences between imperative and declarative programming, emphasizing the shift away from imperative programming.', 'The course educates on the functional interfaces provided by Java, including functions, predicates, consumers, and suppliers.', 'Introduces the combinator design pattern, focusing on its application for validation and step-by-step definition of validations in an interface.', 'Covers the use of streams and optionals to write code in a declarative way.', 'Provides insights into lambdas, callbacks, and the properties of functional programming to ensure a comprehensive understanding of the concept.']}, {'end': 387.902, 'start': 136.169, 'title': 'Functional programming with java', 'summary': 'Discusses the importance of practicing to learn functional programming with java, setting up intellij for java back end development, and the significance of engaging with other students in the private facebook group.', 'duration': 251.733, 'highlights': ['The importance of practicing to learn any new technology is emphasized throughout the course.', 'Setting up IntelliJ for Java back end development is recommended, with the suggestion to enroll in a free course for learning how to use the IDE.', 'Engaging with other students in the private Facebook group is encouraged to address any questions or concerns.']}], 'duration': 377.879, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI10023.jpg', 'highlights': ['Covers the differences between imperative and declarative programming, emphasizing the shift away from imperative programming.', 'The course educates on the functional interfaces provided by Java, including functions, predicates, consumers, and suppliers.', 'Introduces the combinator design pattern, focusing on its application for validation and step-by-step definition of validations in an interface.', 'Covers the use of streams and optionals to write code in a declarative way.', 'Provides insights into lambdas, callbacks, and the properties of functional programming to ensure a comprehensive understanding of the concept.', 'The importance of practicing to learn any new technology is emphasized throughout the course.', 'Setting up IntelliJ for Java back end development is recommended, with the suggestion to enroll in a free course for learning how to use the IDE.', 'Engaging with other students in the private Facebook group is encouraged to address any questions or concerns.']}, {'end': 1090.387, 'segs': [{'end': 448.055, 'src': 'embed', 'start': 414.634, 'weight': 2, 'content': [{'end': 420.879, 'text': "So I'm going to select package and then right here I'm going to name this as imperative and then okay.", 'start': 414.634, 'duration': 6.245}, {'end': 424.381, 'text': 'Now inside, go ahead and create a class.', 'start': 421.659, 'duration': 2.722}, {'end': 427.683, 'text': 'And this will be called as main.', 'start': 425.421, 'duration': 2.262}, {'end': 430.824, 'text': 'Now let me collapse this.', 'start': 429.324, 'duration': 1.5}, {'end': 438.729, 'text': "And inside I'm going to type PS and then VM for public static main.", 'start': 431.925, 'duration': 6.804}, {'end': 440.29, 'text': 'There we go.', 'start': 439.749, 'duration': 0.541}, {'end': 444.052, 'text': 'And now we have a main method that we can run.', 'start': 440.31, 'duration': 3.742}, {'end': 448.055, 'text': "So let's go ahead and define a list.", 'start': 445.051, 'duration': 3.004}], 'summary': 'Creating a main class with a public static main method to define a list.', 'duration': 33.421, 'max_score': 414.634, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI414634.jpg'}, {'end': 602.217, 'src': 'heatmap', 'start': 504.749, 'weight': 1, 'content': [{'end': 514.241, 'text': "And then right here, what we're going to do or actually underneath is simply say private final and then gender.", 'start': 504.749, 'duration': 9.492}, {'end': 516.806, 'text': 'And that will be the gender.', 'start': 514.261, 'duration': 2.545}, {'end': 519.429, 'text': 'And let me add this to constructor.', 'start': 516.826, 'duration': 2.603}, {'end': 522.243, 'text': 'And there we go.', 'start': 521.423, 'duration': 0.82}, {'end': 527.445, 'text': 'So now we have this class right here called person.', 'start': 523.224, 'duration': 4.221}, {'end': 530.626, 'text': 'And let me also define a two string method right here.', 'start': 528.325, 'duration': 2.301}, {'end': 532.246, 'text': 'So two and then string.', 'start': 530.786, 'duration': 1.46}, {'end': 533.947, 'text': 'And there we go.', 'start': 533.286, 'duration': 0.661}, {'end': 542.129, 'text': 'So now right here we can simply say list of and then new and then person.', 'start': 534.607, 'duration': 7.522}, {'end': 544.902, 'text': "And right here, let's give you a name.", 'start': 543.161, 'duration': 1.741}, {'end': 545.843, 'text': 'So John.', 'start': 545.042, 'duration': 0.801}, {'end': 548.865, 'text': 'And John is a male.', 'start': 545.863, 'duration': 3.002}, {'end': 551.967, 'text': 'And let me have a static import for this.', 'start': 548.885, 'duration': 3.082}, {'end': 555.71, 'text': "And let's go ahead and duplicate this.", 'start': 553.328, 'duration': 2.382}, {'end': 558.572, 'text': "So I'm going to press command D a couple of times.", 'start': 556.09, 'duration': 2.482}, {'end': 560.373, 'text': 'And there we go.', 'start': 559.752, 'duration': 0.621}, {'end': 561.714, 'text': "So let's have Maria.", 'start': 560.473, 'duration': 1.241}, {'end': 564.115, 'text': "And she's a female.", 'start': 562.955, 'duration': 1.16}, {'end': 567.398, 'text': "Let's have Aisha.", 'start': 565.376, 'duration': 2.022}, {'end': 569.459, 'text': "She's also a female.", 'start': 568.278, 'duration': 1.181}, {'end': 571.95, 'text': 'Just like that.', 'start': 571.209, 'duration': 0.741}, {'end': 574.892, 'text': "Let's have Alex.", 'start': 572.63, 'duration': 2.262}, {'end': 576.433, 'text': "It's a male.", 'start': 575.873, 'duration': 0.56}, {'end': 580.136, 'text': "And let's finally have Alice just like that.", 'start': 576.453, 'duration': 3.683}, {'end': 583.359, 'text': "And Alice, she's, of course, a female.", 'start': 580.737, 'duration': 2.622}, {'end': 594.814, 'text': "So now that we have this list right here, let's go ahead and find out how many females that we have.", 'start': 585.47, 'duration': 9.344}, {'end': 602.217, 'text': 'So the way that we will do it with the imperative approach is let me add a comment right here.', 'start': 595.514, 'duration': 6.703}], 'summary': 'Creating a person class with gender attributes and instantiating a list of persons with genders, then calculating the count of females using the imperative approach.', 'duration': 97.468, 'max_score': 504.749, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI504749.jpg'}, {'end': 771.714, 'src': 'embed', 'start': 715.29, 'weight': 0, 'content': [{'end': 721.955, 'text': 'So right here you can see that we have only females in our output.', 'start': 715.29, 'duration': 6.665}, {'end': 727.779, 'text': 'And basically this is pretty much what imperative programming is.', 'start': 722.875, 'duration': 4.904}, {'end': 732.443, 'text': 'So basically we are defining every single detail.', 'start': 728.4, 'duration': 4.043}, {'end': 738.667, 'text': 'So right here you can see that first we have an empty list and then we loop through that.', 'start': 732.623, 'duration': 6.044}, {'end': 741.212, 'text': 'And then we have an if statement.', 'start': 739.591, 'duration': 1.621}, {'end': 747.337, 'text': 'And finally, we have a final for loop looping through females.', 'start': 741.933, 'duration': 5.404}, {'end': 752.54, 'text': 'And you can see that there is a lot of logic, not a substantial amount of logic.', 'start': 747.917, 'duration': 4.623}, {'end': 756.143, 'text': 'But you can see that, for example, this if statement is some logic.', 'start': 752.861, 'duration': 3.282}, {'end': 762.087, 'text': 'And also you can see that this is a lot of code for something very simple.', 'start': 756.803, 'duration': 5.284}, {'end': 766.691, 'text': 'And this is what I wanted to show you about the imperative approach.', 'start': 762.688, 'duration': 4.003}, {'end': 771.714, 'text': "Next, let's go ahead and implement this using the declarative approach.", 'start': 767.231, 'duration': 4.483}], 'summary': 'Imperative approach: defining every detail with a lot of logic and code for something simple.', 'duration': 56.424, 'max_score': 715.29, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI715290.jpg'}], 'start': 388.502, 'title': 'Implementing declarative approach in java', 'summary': 'Covers creating a package, class, list, and implementing imperative and declarative approaches in java. the imperative approach uses a substantial amount of code for a simple task, while the declarative approach is much neater and concise, achieved using streams with collections.', 'chapters': [{'end': 1090.387, 'start': 388.502, 'title': 'Implementing declarative approach in java', 'summary': 'Covers the process of creating a package, class, list, and implementing imperative and declarative approaches in java. the imperative approach uses a substantial amount of code for a simple task, while the declarative approach is much neater and concise, achieved using streams with collections.', 'duration': 701.885, 'highlights': ['Creating a package, class, and list in Java', 'Implementing imperative approach to find females in a list', 'Comparing imperative and declarative approaches']}], 'duration': 701.885, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI388502.jpg', 'highlights': ['Implementing imperative approach to find females in a list', 'Comparing imperative and declarative approaches', 'Creating a package, class, and list in Java']}, {'end': 2561.889, 'segs': [{'end': 1172.779, 'src': 'embed', 'start': 1143.429, 'weight': 4, 'content': [{'end': 1151.094, 'text': 'So basically, this package contains functional interfaces that provides target times for Lambda expressions and method references.', 'start': 1143.429, 'duration': 7.665}, {'end': 1157.295, 'text': 'So each functional interface has a single abstract method.', 'start': 1152.034, 'duration': 5.261}, {'end': 1164.797, 'text': 'Basically, you can have one interface with multiple default methods,', 'start': 1157.895, 'duration': 6.902}, {'end': 1172.779, 'text': 'but you must have only one single abstract method to be considered as a functional interface.', 'start': 1164.797, 'duration': 7.982}], 'summary': 'Package contains functional interfaces with single abstract method.', 'duration': 29.35, 'max_score': 1143.429, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI1143429.jpg'}, {'end': 1230.627, 'src': 'embed', 'start': 1199.679, 'weight': 0, 'content': [{'end': 1206.56, 'text': 'So this package right here contains a bunch of functional interfaces right here.', 'start': 1199.679, 'duration': 6.881}, {'end': 1216.462, 'text': 'You can see by consumer, by function, binary operator, by predicate, volume supplier, consumer, and the list goes on.', 'start': 1206.58, 'duration': 9.882}, {'end': 1219.243, 'text': 'So they are pretty much identical.', 'start': 1217.102, 'duration': 2.141}, {'end': 1221.263, 'text': 'apart from the type.', 'start': 1220.043, 'duration': 1.22}, {'end': 1230.627, 'text': 'So the ones that you will most likely be using are functions by functions, predicates by predicates and consumers.', 'start': 1221.283, 'duration': 9.344}], 'summary': 'The package contains various functional interfaces such as consumer, function, binary operator, predicate, and supplier, with functions, predicates, and consumers being the most commonly used ones.', 'duration': 30.948, 'max_score': 1199.679, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI1199679.jpg'}, {'end': 1531.856, 'src': 'embed', 'start': 1494.774, 'weight': 3, 'content': [{'end': 1501.693, 'text': 'So where is a function? So this one right here.', 'start': 1494.774, 'duration': 6.919}, {'end': 1510.999, 'text': 'So this says that represents a function that accepts one argument and then produces a result.', 'start': 1502.573, 'duration': 8.426}, {'end': 1514.302, 'text': 'So this is pretty much what we have here.', 'start': 1511.88, 'duration': 2.422}, {'end': 1516.723, 'text': 'Right So this function that we have.', 'start': 1514.622, 'duration': 2.101}, {'end': 1519.986, 'text': 'So this is a normal function in Java.', 'start': 1516.844, 'duration': 3.142}, {'end': 1522.347, 'text': 'So this is what you are used to.', 'start': 1520.006, 'duration': 2.341}, {'end': 1531.856, 'text': 'So this takes an input and then returns one single Apple right here.', 'start': 1522.928, 'duration': 8.928}], 'summary': 'Java function that accepts one argument and returns one apple.', 'duration': 37.082, 'max_score': 1494.774, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI1494774.jpg'}, {'end': 2074.587, 'src': 'embed', 'start': 2037.809, 'weight': 1, 'content': [{'end': 2050.952, 'text': 'And let me simply say add by one and then multiply by ten.', 'start': 2037.809, 'duration': 13.143}, {'end': 2051.773, 'text': 'There we go.', 'start': 2050.972, 'duration': 0.801}, {'end': 2057.176, 'text': "So if I put this on a new line and you can see exactly what it's doing.", 'start': 2053.214, 'duration': 3.962}, {'end': 2062.96, 'text': "So now let's go ahead and simply say add by one and multiply by ten.", 'start': 2057.677, 'duration': 5.283}, {'end': 2065.737, 'text': 'And then simply say apply.', 'start': 2064.315, 'duration': 1.422}, {'end': 2072.424, 'text': 'And you can see that you can keep on chaining these functions as you go along.', 'start': 2065.757, 'duration': 6.667}, {'end': 2074.587, 'text': "But for now, let's simply chain two functions.", 'start': 2072.504, 'duration': 2.083}], 'summary': 'Chaining functions to add by one and multiply by ten.', 'duration': 36.778, 'max_score': 2037.809, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI2037809.jpg'}, {'end': 2188.542, 'src': 'embed', 'start': 2154.769, 'weight': 2, 'content': [{'end': 2167.593, 'text': 'But instead of taking one input, it takes two inputs and produces one output and by function for two things.', 'start': 2154.769, 'duration': 12.824}, {'end': 2173.415, 'text': 'Right So right here, we have this function right here.', 'start': 2168.073, 'duration': 5.342}, {'end': 2176.617, 'text': 'So this one add by one and multiply by ten.', 'start': 2173.575, 'duration': 3.042}, {'end': 2183.6, 'text': "So let's say that the first number that we give it is the one that it should increment.", 'start': 2177.417, 'duration': 6.183}, {'end': 2188.542, 'text': 'And then the second one is the one that it should multiply by.', 'start': 2183.86, 'duration': 4.682}], 'summary': 'A function takes two inputs, increments one and multiplies the other by ten.', 'duration': 33.773, 'max_score': 2154.769, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI2154769.jpg'}], 'start': 1090.707, 'title': 'Java functional interfaces and functions', 'summary': 'Covers java util function package for lambda expressions and method references, examples of predicates, consumers, and functions used in stream operations, transformation of conventional functions to functional style, chaining functions to achieve desired output, by functions with different data types, and practical usage of bi-function in java.', 'chapters': [{'end': 1390.008, 'start': 1090.707, 'title': 'Understanding java functional interfaces', 'summary': 'Introduces the java util function package, containing functional interfaces for lambda expressions and method references, with examples of predicates, consumers, and functions, used in stream operations, to enhance understanding of functional programming in java.', 'duration': 299.301, 'highlights': ['The Java Util Function package provides functional interfaces for Lambda expressions and method references, including predicates, consumers, and functions, used in stream operations, to enhance understanding of functional programming in Java.', 'Each functional interface in the Java Util Function package has a single abstract method, allowing for the use of Lambda expressions and method references.', 'The package contains various functional interfaces such as consumer, function, binary operator, predicate, and supplier, with the main ones being functions, predicates, and consumers, which are extensively used in functional programming in Java.']}, {'end': 1779.186, 'start': 1390.228, 'title': 'Introduction to java functions', 'summary': 'Explains the concept of java functions, demonstrating the transformation of a conventional function to a functional style function using a simple example, showcasing the use of the function interface and lambda expressions.', 'duration': 388.958, 'highlights': ['The chapter demonstrates the transformation of a conventional function to a functional style function, showcasing the use of the function interface and Lambda expressions, providing a clear understanding of the concept (relevance: 5)', 'The chapter explains the concept of Java functions, demonstrating the transformation of a conventional function to a functional style function using a simple example, showcasing the use of the function interface and Lambda expressions (relevance: 4)', 'The chapter showcases the use of the function interface and Lambda expressions to transform a conventional function into a functional style function, providing practical insights into the implementation of Java functions (relevance: 3)', 'The chapter introduces the concept of Java functions, demonstrating the transformation of a conventional function to a functional style function using a simple example, highlighting the use of the function interface and Lambda expressions (relevance: 2)', 'The chapter provides a clear understanding of the concept of Java functions, showcasing the transformation of a conventional function to a functional style function using a simple example, emphasizing the use of the function interface and Lambda expressions (relevance: 1)']}, {'end': 2115.929, 'start': 1779.926, 'title': 'Chaining functions for desired output', 'summary': 'Discusses the concept of combining multiple functions together to achieve a desired output, showcasing the process of chaining two functions to produce a calculated result, demonstrated with an example yielding an output of 20.', 'duration': 336.003, 'highlights': ['The process of chaining two functions together to produce a calculated result is demonstrated, showcasing the concept of combining multiple functions to achieve a desired output, yielding an example result of 20.', "The instructor explains the use of applying the 'increment by one' function followed by the 'multiply by ten' function, showcasing the chaining of functions to calculate a specific result, with the example result being 20.", 'The concept of combining multiple functions to achieve a desired output is introduced, emphasizing the process of chaining functions to generate a calculated result.']}, {'end': 2296.757, 'start': 2116.009, 'title': 'Chaining functions and by functions', 'summary': 'Explains the concept of chaining functions together and introduces the concept of by functions, which take two inputs and produce one output, with an example of adding one and multiplying by ten. it also mentions the ability to have different data types for the inputs.', 'duration': 180.748, 'highlights': ['The chapter introduces the concept of by functions, explaining that they take two inputs and produce one output, with an example of adding one and multiplying by ten.', 'The transcript demonstrates chaining functions together by showing an example of using multiple functions in sequence to perform operations on a given input.', 'The chapter mentions the ability to have different data types for the inputs of by functions, providing flexibility depending on the circumstances.']}, {'end': 2561.889, 'start': 2297.197, 'title': 'Using bi-function in java', 'summary': 'Introduces the concept of bi-function in java, demonstrating its usage in creating a function that takes two arguments and produces a result, as well as showcasing a practical example of using a bi-function to calculate a value based on two input arguments.', 'duration': 264.692, 'highlights': ['The chapter explains the concept of Bi-Function in Java, demonstrating its usage in creating a function that takes two arguments and produces a result.', 'A practical example of using a Bi-Function to calculate a value based on two input arguments is demonstrated.', 'The differences between a regular function and a Bi-Function are explained, emphasizing that a Bi-Function takes two arguments and returns a result.']}], 'duration': 1471.182, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI1090707.jpg', 'highlights': ['The Java Util Function package provides functional interfaces for Lambda expressions and method references, including predicates, consumers, and functions, used in stream operations, to enhance understanding of functional programming in Java.', 'The process of chaining two functions together to produce a calculated result is demonstrated, showcasing the concept of combining multiple functions to achieve a desired output, yielding an example result of 20.', 'The chapter introduces the concept of by functions, explaining that they take two inputs and produce one output, with an example of adding one and multiplying by ten.', 'The chapter explains the concept of Bi-Function in Java, demonstrating its usage in creating a function that takes two arguments and produces a result.', 'Each functional interface in the Java Util Function package has a single abstract method, allowing for the use of Lambda expressions and method references.']}, {'end': 3144.567, 'segs': [{'end': 2655.09, 'src': 'embed', 'start': 2590.969, 'weight': 1, 'content': [{'end': 2596.292, 'text': 'So let me show you exactly first the non functional way and then the functional way.', 'start': 2590.969, 'duration': 5.323}, {'end': 2602.996, 'text': "So let's say that right here again, let's have public static void main.", 'start': 2596.893, 'duration': 6.103}, {'end': 2610.841, 'text': "And right here, let's go ahead and define a static class and then customer.", 'start': 2603.016, 'duration': 7.825}, {'end': 2616.271, 'text': "And then let's go ahead and simply say private final.", 'start': 2612.87, 'duration': 3.401}, {'end': 2617.932, 'text': 'And let me put this full screen.', 'start': 2616.671, 'duration': 1.261}, {'end': 2633.316, 'text': 'So private final and then string and then customer name, private final string, customer phone number, just like that.', 'start': 2618.072, 'duration': 15.244}, {'end': 2643.498, 'text': "So next let me hide that to constructor and Now what I'm going to do is have a function right here.", 'start': 2634.537, 'duration': 8.961}, {'end': 2646.121, 'text': 'So let me go and simply say static.', 'start': 2644.359, 'duration': 1.762}, {'end': 2651.847, 'text': "And then right here, let's go ahead and say greet and then customer.", 'start': 2647.402, 'duration': 4.445}, {'end': 2655.09, 'text': 'So this will take a customer.', 'start': 2653.028, 'duration': 2.062}], 'summary': 'Demonstration of non-functional and functional programming using java with class and function definitions.', 'duration': 64.121, 'max_score': 2590.969, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI2590969.jpg'}, {'end': 2911.823, 'src': 'embed', 'start': 2805.982, 'weight': 0, 'content': [{'end': 2810.685, 'text': 'So this is using functional interface.', 'start': 2805.982, 'duration': 4.703}, {'end': 2821.473, 'text': 'So this is actually consumer and then normal Java function.', 'start': 2811.866, 'duration': 9.607}, {'end': 2832.505, 'text': 'Right. So if I run this, You can see that we have the exact same thing, right?', 'start': 2822.634, 'duration': 9.871}, {'end': 2838.948, 'text': 'So basically, a consumer takes one argument and pretty much returns nothing.', 'start': 2833.266, 'duration': 5.682}, {'end': 2847.112, 'text': "It's like a void function, right? So this customer right here is the data type of the input.", 'start': 2839.228, 'duration': 7.884}, {'end': 2848.512, 'text': 'So is this one.', 'start': 2847.152, 'duration': 1.36}, {'end': 2855.175, 'text': 'This customer is the actual name of the input.', 'start': 2850.273, 'duration': 4.902}, {'end': 2856.716, 'text': 'So this customer right here.', 'start': 2855.195, 'duration': 1.521}, {'end': 2858.69, 'text': 'And void.', 'start': 2857.768, 'duration': 0.922}, {'end': 2862.677, 'text': 'You could technically say that void is a consumer.', 'start': 2859.231, 'duration': 3.446}, {'end': 2867.245, 'text': 'So if you have any questions on this, go ahead and drop me a message.', 'start': 2863.759, 'duration': 3.486}, {'end': 2870.511, 'text': "Otherwise, let's learn about by consumers.", 'start': 2867.966, 'duration': 2.545}, {'end': 2876.793, 'text': 'All right.', 'start': 2876.252, 'duration': 0.541}, {'end': 2879.755, 'text': "So let's go ahead and learn about the buy consumer.", 'start': 2876.873, 'duration': 2.882}, {'end': 2888.584, 'text': "So the same way that we've done with functions and by functions, we have the same for consumer.", 'start': 2880.216, 'duration': 8.368}, {'end': 2895.831, 'text': 'So pretty much every one of these functional interfaces, they have the buy version.', 'start': 2888.664, 'duration': 7.167}, {'end': 2898.853, 'text': 'So in front of it, they have the buy version.', 'start': 2895.871, 'duration': 2.982}, {'end': 2907.9, 'text': 'So the buy simply means that instead of taking one argument, it takes two arguments.', 'start': 2899.514, 'duration': 8.386}, {'end': 2911.823, 'text': "Now let's go ahead and change this function.", 'start': 2908.56, 'duration': 3.263}], 'summary': 'The transcript discusses functional interfaces, particularly the consumer interface, and introduces the buy consumer interface for handling two arguments.', 'duration': 105.841, 'max_score': 2805.982, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI2805982.jpg'}, {'end': 3144.567, 'src': 'embed', 'start': 3114.402, 'weight': 5, 'content': [{'end': 3121.99, 'text': "So I've gone ahead inside of the functional interface package, created this underscore predicate class.", 'start': 3114.402, 'duration': 7.588}, {'end': 3128.016, 'text': "And inside, let's go ahead and simply type public static void main.", 'start': 3122.871, 'duration': 5.145}, {'end': 3131.199, 'text': "And let's go ahead and learn about predicates.", 'start': 3129.277, 'duration': 1.922}, {'end': 3136.342, 'text': "So let's say that you want to do the following.", 'start': 3132.039, 'duration': 4.303}, {'end': 3139.444, 'text': "So let's say that you have a function.", 'start': 3136.902, 'duration': 2.542}, {'end': 3140.785, 'text': 'So a normal travel function.', 'start': 3139.464, 'duration': 1.321}, {'end': 3141.585, 'text': 'So static.', 'start': 3140.885, 'duration': 0.7}, {'end': 3144.567, 'text': 'And then this will return a Boolean.', 'start': 3142.446, 'duration': 2.121}], 'summary': 'Created underscore predicate class for learning about predicates.', 'duration': 30.165, 'max_score': 3114.402, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI3114402.jpg'}], 'start': 2562.409, 'title': 'Java consumer and functional interfaces', 'summary': 'Covers the concept of consumer in java, demonstrating non-functional and functional ways of implementation, and showcases sample code for greeting a customer with their name and phone number. it also explains the usage of functional interfaces like consumer and buy consumer in java, demonstrating how they can take one or two arguments and return void, and introduces predicates.', 'chapters': [{'end': 2735.389, 'start': 2562.409, 'title': 'Learning about consumer in java', 'summary': 'Covers the concept of consumer in java, demonstrating the non-functional and functional ways of implementation, and showcases a sample code for greeting a customer with their name and phone number.', 'duration': 172.98, 'highlights': ['The chapter covers the concept of Consumer in Java', 'Demonstrating the non-functional and functional ways of implementation', 'Showcases a sample code for greeting a customer with their name and phone number']}, {'end': 3144.567, 'start': 2735.389, 'title': 'Java functional interfaces', 'summary': 'Explains the usage of functional interfaces such as consumer and buy consumer in java, demonstrating how they can take one or two arguments and return void, and also introduces predicates.', 'duration': 409.178, 'highlights': ['The chapter demonstrates the usage of the consumer functional interface in Java, which takes one argument and returns void, showcasing how it can be used to greet customers and modify the behavior based on input data.', "It explains the concept of buy consumer in Java, which is the two-argument version of consumer, and how it can be used to modify behavior based on multiple input arguments, such as showing or hiding a customer's phone number.", 'The chapter introduces predicates in Java, highlighting their usage as normal Java functions that return a Boolean value.']}], 'duration': 582.158, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI2562409.jpg', 'highlights': ['The chapter covers the concept of Consumer in Java', 'Demonstrating the non-functional and functional ways of implementation', 'Showcases a sample code for greeting a customer with their name and phone number', 'The chapter demonstrates the usage of the consumer functional interface in Java, which takes one argument and returns void, showcasing how it can be used to greet customers and modify the behavior based on input data', "It explains the concept of buy consumer in Java, which is the two-argument version of consumer, and how it can be used to modify behavior based on multiple input arguments, such as showing or hiding a customer's phone number", 'The chapter introduces predicates in Java, highlighting their usage as normal Java functions that return a Boolean value']}, {'end': 3615.155, 'segs': [{'end': 3212.109, 'src': 'embed', 'start': 3145.828, 'weight': 0, 'content': [{'end': 3155.934, 'text': "And right here, let's simply go ahead and say, is phone number valid? So let's go ahead and simply take a phone number.", 'start': 3145.828, 'duration': 10.106}, {'end': 3159.897, 'text': 'So string and then phone number.', 'start': 3156.075, 'duration': 3.822}, {'end': 3164.061, 'text': "And for now, let's go ahead and keep it very simple.", 'start': 3161.278, 'duration': 2.783}, {'end': 3172.467, 'text': "But this validation is not real, but it's just to illustrate the actual example and purpose of predicates.", 'start': 3164.501, 'duration': 7.966}, {'end': 3179.833, 'text': "So right here, let's simply say that this phone number in order to be valid, it has to meet the following criteria.", 'start': 3173.248, 'duration': 6.585}, {'end': 3182.154, 'text': "So let's return phone number.", 'start': 3180.393, 'duration': 1.761}, {'end': 3187.76, 'text': 'dot and then starts with.', 'start': 3183.396, 'duration': 4.364}, {'end': 3194.406, 'text': "And let's say that the phone number has to start with zero seven.", 'start': 3188.941, 'duration': 5.465}, {'end': 3205.898, 'text': "And let's also say that the phone number and phone number dot and then length is equal to eleven.", 'start': 3195.427, 'duration': 10.471}, {'end': 3212.109, 'text': 'So this is a simple phone validation method.', 'start': 3207.566, 'duration': 4.543}], 'summary': 'Phone number validation requires starting with 07 and having a length of 11.', 'duration': 66.281, 'max_score': 3145.828, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI3145828.jpg'}, {'end': 3339.098, 'src': 'embed', 'start': 3305.492, 'weight': 3, 'content': [{'end': 3312.317, 'text': 'Now, in order for us to use the functional style, we can use the predicate.', 'start': 3305.492, 'duration': 6.825}, {'end': 3314.178, 'text': 'So predicate right here.', 'start': 3312.877, 'duration': 1.301}, {'end': 3319.641, 'text': 'So you can see represents a Boolean valid function of one argument.', 'start': 3314.258, 'duration': 5.383}, {'end': 3325.166, 'text': 'Right So right here, the way that we use a predicate is as follows.', 'start': 3320.042, 'duration': 5.124}, {'end': 3330.951, 'text': 'So this exact same function as predicate will be something like this static.', 'start': 3325.386, 'duration': 5.565}, {'end': 3333.513, 'text': 'And then right here, predicate.', 'start': 3331.811, 'duration': 1.702}, {'end': 3339.098, 'text': 'And then this will take a string.', 'start': 3335.815, 'duration': 3.283}], 'summary': 'Using the predicate in functional style for boolean validation.', 'duration': 33.606, 'max_score': 3305.492, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI3305492.jpg'}, {'end': 3509.533, 'src': 'embed', 'start': 3477.16, 'weight': 4, 'content': [{'end': 3482.425, 'text': "And this predicate will take a string and then let's say contains.", 'start': 3477.16, 'duration': 5.265}, {'end': 3487.425, 'text': 'and then number.', 'start': 3486.164, 'duration': 1.261}, {'end': 3489.847, 'text': "And then let's simply say number three.", 'start': 3488.166, 'duration': 1.681}, {'end': 3493.651, 'text': 'So if the phone number contains number three, so phone number.', 'start': 3490.027, 'duration': 3.624}, {'end': 3503.099, 'text': "And right here I'm simply going to say phone number dot and then contains and then three just like that.", 'start': 3494.992, 'duration': 8.107}, {'end': 3509.533, 'text': 'Now, the way that you change predicates is as follow.', 'start': 3504.249, 'duration': 5.284}], 'summary': 'A predicate that checks if a phone number contains the number three is demonstrated.', 'duration': 32.373, 'max_score': 3477.16, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI3477160.jpg'}], 'start': 3145.828, 'title': 'Using predicates for phone number validation', 'summary': "Discusses a simple phone number validation method using predicates, where the phone number must start with '07' and have a length of 11 characters, along with examples. it also explores using predicates to create boolean valid functions of one argument and testing multiple predicates for true and false outcomes.", 'chapters': [{'end': 3304.852, 'start': 3145.828, 'title': 'Simple phone validation', 'summary': "Discusses a simple phone number validation method using predicates, where the phone number must start with '07' and have a length of 11 characters, with examples showing the validation results.", 'duration': 159.024, 'highlights': ["The phone number validation method requires the phone number to start with '07' and have a length of 11 characters, with examples demonstrating the validation results.", 'The provided examples illustrate the validity of phone numbers based on the defined criteria, with specific phone numbers being tested and confirmed as valid or invalid.']}, {'end': 3615.155, 'start': 3305.492, 'title': 'Using predicates in functional style', 'summary': 'Discusses using predicates to create boolean valid functions of one argument and testing multiple predicates to check phone number validity, resulting in true and false outcomes.', 'duration': 309.663, 'highlights': ['Using predicate to represent a Boolean valid function of one argument', 'Creating predicates to test phone number validity resulting in true and false outcomes', 'Combining predicates to check if a phone number contains a specific digit']}], 'duration': 469.327, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI3145828.jpg', 'highlights': ["The phone number validation method requires the phone number to start with '07' and have a length of 11 characters, with examples demonstrating the validation results.", 'The provided examples illustrate the validity of phone numbers based on the defined criteria, with specific phone numbers being tested and confirmed as valid or invalid.', 'Creating predicates to test phone number validity resulting in true and false outcomes', 'Using predicate to represent a Boolean valid function of one argument', 'Combining predicates to check if a phone number contains a specific digit']}, {'end': 4697.623, 'segs': [{'end': 3650.387, 'src': 'embed', 'start': 3615.295, 'weight': 0, 'content': [{'end': 3616.476, 'text': 'As I explained why.', 'start': 3615.295, 'duration': 1.181}, {'end': 3619.058, 'text': 'And the first one is false.', 'start': 3616.496, 'duration': 2.562}, {'end': 3624.382, 'text': 'Now you can use and but you can also use or.', 'start': 3619.979, 'duration': 4.403}, {'end': 3628.845, 'text': 'So or means either one of them is true.', 'start': 3625.302, 'duration': 3.543}, {'end': 3635.85, 'text': 'So if I was to say right here, so instead of and I can use or right.', 'start': 3629.425, 'duration': 6.425}, {'end': 3640.799, 'text': 'And then if I remove three here and put a zero.', 'start': 3636.41, 'duration': 4.389}, {'end': 3642.26, 'text': 'Run this.', 'start': 3641.659, 'duration': 0.601}, {'end': 3646.083, 'text': 'This will still be true.', 'start': 3644.162, 'duration': 1.921}, {'end': 3650.387, 'text': "It's true because we only need one condition to be true.", 'start': 3646.103, 'duration': 4.284}], 'summary': "Using 'or' instead of 'and' in a condition makes it true if at least one condition is true.", 'duration': 35.092, 'max_score': 3615.295, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI3615295.jpg'}, {'end': 3841.855, 'src': 'embed', 'start': 3811.889, 'weight': 3, 'content': [{'end': 3818.855, 'text': 'So the purpose of this function right here is simply to return a value right here.', 'start': 3811.889, 'duration': 6.966}, {'end': 3820.776, 'text': 'So this is the value that it returns.', 'start': 3819.115, 'duration': 1.661}, {'end': 3827.251, 'text': 'So we can do So we can use a supplier to represent the exact same thing.', 'start': 3821.477, 'duration': 5.774}, {'end': 3829.392, 'text': "So I'm going to copy this URL.", 'start': 3827.771, 'duration': 1.621}, {'end': 3841.855, 'text': 'And to have this Java function as functional, we simply have to say supplier or actually static and then supplier.', 'start': 3830.452, 'duration': 11.403}], 'summary': 'Function returns a value, can be represented by a supplier in java.', 'duration': 29.966, 'max_score': 3811.889, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI3811889.jpg'}, {'end': 4050.4, 'src': 'embed', 'start': 4017.311, 'weight': 1, 'content': [{'end': 4024.176, 'text': 'Right So once you start using streams with all of these functional interfaces, you will start to write clean code.', 'start': 4017.311, 'duration': 6.865}, {'end': 4026.358, 'text': "And that's what I'm going to teach you next.", 'start': 4024.616, 'duration': 1.742}, {'end': 4033.225, 'text': 'Okie dokie.', 'start': 4032.384, 'duration': 0.841}, {'end': 4042.073, 'text': "Now that you've learned about consumers, functions, by functions, predicates, by predicates and suppliers.", 'start': 4033.865, 'duration': 8.208}, {'end': 4043.794, 'text': 'And also I think by consumers.', 'start': 4042.173, 'duration': 1.621}, {'end': 4050.4, 'text': "Now let's go ahead and actually learn how this is useful to us when writing code.", 'start': 4044.475, 'duration': 5.925}], 'summary': 'Using functional interfaces and streams leads to writing clean code.', 'duration': 33.089, 'max_score': 4017.311, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI4017311.jpg'}, {'end': 4402.57, 'src': 'embed', 'start': 4376.51, 'weight': 2, 'content': [{'end': 4385.161, 'text': 'So go ahead and simply select the map function and the map function simply does transformations.', 'start': 4376.51, 'duration': 8.651}, {'end': 4387.764, 'text': 'So right here, this takes a person.', 'start': 4385.761, 'duration': 2.003}, {'end': 4392.086, 'text': 'Right And from here what we want to return.', 'start': 4389.345, 'duration': 2.741}, {'end': 4396.628, 'text': 'So I want to return person dot and then the actual gender.', 'start': 4392.606, 'duration': 4.022}, {'end': 4402.57, 'text': "Now let's go ahead and simply say dot and then collect and then collect us to set.", 'start': 4397.468, 'duration': 5.102}], 'summary': "Using map function for transformations on a person's gender.", 'duration': 26.06, 'max_score': 4376.51, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI4376510.jpg'}, {'end': 4681.744, 'src': 'heatmap', 'start': 4596.127, 'weight': 0.803, 'content': [{'end': 4601.211, 'text': "Right Or in this scenario, let's say map to int.", 'start': 4596.127, 'duration': 5.084}, {'end': 4604.994, 'text': 'This takes the actual name.', 'start': 4602.052, 'duration': 2.942}, {'end': 4606.015, 'text': 'So this time is name.', 'start': 4605.094, 'duration': 0.921}, {'end': 4610.098, 'text': 'And then simply say name dot and then length.', 'start': 4607.034, 'duration': 3.064}, {'end': 4615.164, 'text': "And right here we're not going to collect to set.", 'start': 4610.979, 'duration': 4.185}, {'end': 4616.927, 'text': 'So let me delete that.', 'start': 4615.745, 'duration': 1.182}, {'end': 4621.853, 'text': 'And then we can even change this to method reference just like that.', 'start': 4617.567, 'duration': 4.286}, {'end': 4627.657, 'text': 'If I run this, You can see another length of each name.', 'start': 4622.474, 'duration': 5.183}, {'end': 4631.201, 'text': 'So this is the power of streams.', 'start': 4628.338, 'duration': 2.863}, {'end': 4635.926, 'text': 'So you might be asking, what is this? Right.', 'start': 4632.142, 'duration': 3.784}, {'end': 4641.732, 'text': 'Or what is this? Or what is this? So let me just show you right now.', 'start': 4636.266, 'duration': 5.466}, {'end': 4646.817, 'text': "So what I'm going to do here is simply extract this to a variable.", 'start': 4642.352, 'duration': 4.465}, {'end': 4655.366, 'text': 'and also this to a variable and also this to a variable.', 'start': 4648.459, 'duration': 6.907}, {'end': 4658.41, 'text': 'And now check this out.', 'start': 4656.929, 'duration': 1.481}, {'end': 4661.972, 'text': "So this is what you've been learning in the past videos.", 'start': 4658.81, 'duration': 3.162}, {'end': 4670.017, 'text': 'So look at this function that takes a person returns a string and then the same here to int function.', 'start': 4662.212, 'duration': 7.805}, {'end': 4673.239, 'text': "We haven't learned to int function, but basically this is the same thing.", 'start': 4670.057, 'duration': 3.182}, {'end': 4677.841, 'text': 'So this takes a string and returns an integer.', 'start': 4673.739, 'duration': 4.102}, {'end': 4679.022, 'text': "That's all it does.", 'start': 4678.082, 'duration': 0.94}, {'end': 4681.744, 'text': 'And you can see right here in the consumer.', 'start': 4679.522, 'duration': 2.222}], 'summary': 'Demonstration of mapping to int and method reference using streams in java.', 'duration': 85.617, 'max_score': 4596.127, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI4596127.jpg'}], 'start': 3615.295, 'title': 'Logical operators, supplier functional interface, java streams, and transformation', 'summary': "Covers logical operators 'and' and 'or', supplier functional interface, and practical application of functional interfaces in java streams, including examples and benefits of using various functional interfaces in java streams for writing cleaner code.", 'chapters': [{'end': 3672.577, 'start': 3615.295, 'title': 'Logical operators in programming', 'summary': "Explains logical operators 'and' and 'or' in programming, demonstrating how they work and when to use them, along with an example showing how changing the condition from 'and' to 'or' affects the outcome of the code.", 'duration': 57.282, 'highlights': ["The chapter emphasizes the difference between 'and' and 'or' logical operators, highlighting that 'or' means either one of the conditions is true, while 'and' requires all conditions to be true.", "It demonstrates an example where changing the logical operator from 'and' to 'or' affects the truth value of the condition, showing that with 'or', only one condition needs to be true for the overall statement to be true."]}, {'end': 3984.438, 'start': 3673.317, 'title': 'Supplier functional interface', 'summary': 'Introduces the concept of a supplier functional interface in java, which can be used to return any kind of value, such as strings, custom classes, objects, or arrays, and demonstrates how to use it with examples.', 'duration': 311.121, 'highlights': ['The supplier functional interface in Java can be used to return any kind of value, such as strings, custom classes, objects, or arrays.', 'Demonstration of using a supplier to return a list of URLs and how it can be applied to return custom values.', 'An example of using the supplier functional interface to return a specific connection URL for a database.']}, {'end': 4375.83, 'start': 3985.178, 'title': 'Java streams and functional interfaces', 'summary': 'Introduces the concept of functional interfaces and their practical application in java streams, highlighting the benefits of writing cleaner code with functional interfaces and demonstrating the usage of various functional interfaces such as consumers, functions, predicates, and suppliers in the context of java streams.', 'duration': 390.652, 'highlights': ['The chapter introduces the concept of functional interfaces and their practical application in Java streams.', 'Demonstrating the usage of various functional interfaces such as consumers, functions, predicates, and suppliers in the context of Java streams.', 'Highlighting the benefits of writing cleaner code with functional interfaces.']}, {'end': 4697.623, 'start': 4376.51, 'title': 'Java streams and transformation', 'summary': 'Explores the use of map function to transform a list of people into genders, removing duplicates using collect to set, and obtaining the length of each name, showcasing the power of streams in java.', 'duration': 321.113, 'highlights': ['Using the map function to transform a list of people into genders and then using collect to set to remove duplicates, resulting in only male and female genders.', 'Demonstrating how to map the list of names to their respective lengths, showcasing the power of streams in Java.', 'Explaining the concept of consumers and method references in the context of stream operations in Java.']}], 'duration': 1082.328, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI3615295.jpg', 'highlights': ["The chapter emphasizes the difference between 'and' and 'or' logical operators, highlighting that 'or' means either one of the conditions is true, while 'and' requires all conditions to be true.", 'Demonstrating the usage of various functional interfaces such as consumers, functions, predicates, and suppliers in the context of Java streams.', 'Using the map function to transform a list of people into genders and then using collect to set to remove duplicates, resulting in only male and female genders.', 'The supplier functional interface in Java can be used to return any kind of value, such as strings, custom classes, objects, or arrays.']}, {'end': 5456.83, 'segs': [{'end': 4782.189, 'src': 'embed', 'start': 4697.843, 'weight': 1, 'content': [{'end': 4703.671, 'text': "But when you use it with streams, you don't have to have all of this syntax.", 'start': 4697.843, 'duration': 5.828}, {'end': 4707.814, 'text': 'Basically, you can ditch the left hand side and just keep these.', 'start': 4703.771, 'duration': 4.043}, {'end': 4710.617, 'text': 'Right So if I now in line everything.', 'start': 4707.994, 'duration': 2.623}, {'end': 4716.702, 'text': 'So command shift in command shift in there, command shift in there.', 'start': 4710.797, 'duration': 5.905}, {'end': 4718.824, 'text': 'And look at this.', 'start': 4717.843, 'duration': 0.981}, {'end': 4723.119, 'text': 'Right And here even method reference.', 'start': 4720.296, 'duration': 2.823}, {'end': 4724.4, 'text': 'And there we go.', 'start': 4723.879, 'duration': 0.521}, {'end': 4731.747, 'text': 'So, if you want to learn more about streams, go ahead and check my course on Java Streams API,', 'start': 4724.7, 'duration': 7.047}, {'end': 4737.732, 'text': 'where you learn everything about writing code in a declarative way.', 'start': 4731.747, 'duration': 5.985}, {'end': 4739.214, 'text': 'This is all for now.', 'start': 4738.473, 'duration': 0.741}, {'end': 4740.495, 'text': 'Join me in the next one.', 'start': 4739.574, 'duration': 0.921}, {'end': 4746.273, 'text': 'All right.', 'start': 4745.953, 'duration': 0.32}, {'end': 4748.134, 'text': 'Let me show you some other methods right here.', 'start': 4746.313, 'duration': 1.821}, {'end': 4750.035, 'text': 'So still right here.', 'start': 4748.314, 'duration': 1.721}, {'end': 4751.755, 'text': "So let's go ahead.", 'start': 4750.275, 'duration': 1.48}, {'end': 4757.017, 'text': "And for now, I'm going to pretty much just comment everything right here.", 'start': 4752.195, 'duration': 4.822}, {'end': 4758.378, 'text': "So I'm going to comment this.", 'start': 4757.037, 'duration': 1.341}, {'end': 4764.14, 'text': "And right here, let's go ahead and say people don't and then stream.", 'start': 4760.038, 'duration': 4.102}, {'end': 4769.14, 'text': "And then right here, let's go ahead and simply say all and then match.", 'start': 4765.157, 'duration': 3.983}, {'end': 4774.303, 'text': 'Basically, we want to know that in our list we only have females.', 'start': 4769.68, 'duration': 4.623}, {'end': 4775.985, 'text': 'So right here.', 'start': 4774.884, 'duration': 1.101}, {'end': 4777.646, 'text': 'So this takes a predicate.', 'start': 4776.105, 'duration': 1.541}, {'end': 4779.907, 'text': 'And remember, a predicate looks like this.', 'start': 4777.786, 'duration': 2.121}, {'end': 4782.189, 'text': 'So this will take a person.', 'start': 4780.568, 'duration': 1.621}], 'summary': 'Using streams simplifies syntax, encourages declarative coding. check java streams api course for more.', 'duration': 84.346, 'max_score': 4697.843, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI4697843.jpg'}, {'end': 5020.655, 'src': 'embed', 'start': 4991.584, 'weight': 4, 'content': [{'end': 5000.833, 'text': 'Next, let me also show you that you can use all of the goodness of Java functional interfaces with optionals, because again,', 'start': 4991.584, 'duration': 9.249}, {'end': 5007.039, 'text': 'optionals changes the way that you deal with null pointer exceptions in Java.', 'start': 5000.833, 'duration': 6.206}, {'end': 5008.66, 'text': 'Join me in the next one.', 'start': 5007.68, 'duration': 0.98}, {'end': 5009.181, 'text': 'See you.', 'start': 5008.981, 'duration': 0.2}, {'end': 5020.655, 'text': 'All right, let me go ahead and show you how to use Java Optionals with functional interfaces.', 'start': 5014.71, 'duration': 5.945}], 'summary': 'Java optionals enhance null pointer exception handling in functional interfaces.', 'duration': 29.071, 'max_score': 4991.584, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI4991584.jpg'}, {'end': 5428.871, 'src': 'embed', 'start': 5406.377, 'weight': 0, 'content': [{'end': 5414.321, 'text': 'So again, I can remove that and have method reference and look at how this now starts to flow, guys.', 'start': 5406.377, 'duration': 7.944}, {'end': 5424.148, 'text': 'So this is the power of functional programming streams, optionals, And once you start writing code like this,', 'start': 5414.862, 'duration': 9.286}, {'end': 5428.871, 'text': 'you can achieve a lot more instead of using imperative approach.', 'start': 5424.148, 'duration': 4.723}], 'summary': 'Functional programming enables achieving more with method references and streams.', 'duration': 22.494, 'max_score': 5406.377, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI5406377.jpg'}], 'start': 4697.843, 'title': 'Simplifying java streams', 'summary': 'Simplifies syntax for streams in java, highlighting the benefits of using method references and a declarative approach, and explores java streams, predicates, and optionals, demonstrating how to filter, manipulate, and handle null values using functional programming techniques.', 'chapters': [{'end': 4757.017, 'start': 4697.843, 'title': 'Simplified syntax for streams', 'summary': 'Explains how to simplify syntax for streams in java, demonstrating the removal of unnecessary syntax and highlighting the benefits of using method references and a declarative approach in writing code.', 'duration': 59.174, 'highlights': ['The chapter demonstrates the simplification of syntax for streams in Java, showcasing the removal of unnecessary syntax and the utilization of method references.', 'The speaker encourages further learning about streams through a Java Streams API course, emphasizing the benefits of writing code in a declarative way.', "The transcript also indicates the speaker's intention to cover additional methods and temporarily comment out certain code segments."]}, {'end': 5456.83, 'start': 4757.037, 'title': 'Java streams and optionals', 'summary': 'Explores java streams, predicates, and optionals, demonstrating how to filter, manipulate and handle null values using functional programming techniques, and highlights the benefits for java developers in writing more efficient code.', 'duration': 699.793, 'highlights': ["The chapter covers the usage of predicates with streams to filter elements based on specific conditions, such as ensuring a list contains only females, and demonstrates the use of methods like 'anyMatch', 'allMatch', and 'nonMatch' to evaluate the presence of specified elements in the list.", "The usage of Java optionals is exemplified, showcasing methods like 'orElse', 'orElseThrow', 'ifPresent', and the utilization of functional interfaces to handle null values and provide default values or actions when dealing with optional values.", 'The chapter emphasizes the benefits of functional programming techniques, including streams and optionals, in writing more efficient and concise Java code, providing a path for developers to enhance their skills and productivity.']}], 'duration': 758.987, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI4697843.jpg', 'highlights': ['The chapter emphasizes the benefits of functional programming techniques, including streams and optionals, in writing more efficient and concise Java code, providing a path for developers to enhance their skills and productivity.', "The chapter covers the usage of predicates with streams to filter elements based on specific conditions, such as ensuring a list contains only females, and demonstrates the use of methods like 'anyMatch', 'allMatch', and 'nonMatch' to evaluate the presence of specified elements in the list.", 'The chapter demonstrates the simplification of syntax for streams in Java, showcasing the removal of unnecessary syntax and the utilization of method references.', 'The speaker encourages further learning about streams through a Java Streams API course, emphasizing the benefits of writing code in a declarative way.', "The usage of Java optionals is exemplified, showcasing methods like 'orElse', 'orElseThrow', 'ifPresent', and the utilization of functional interfaces to handle null values and provide default values or actions when dealing with optional values.", "The transcript also indicates the speaker's intention to cover additional methods and temporarily comment out certain code segments."]}, {'end': 6904.982, 'segs': [{'end': 5558.039, 'src': 'embed', 'start': 5529.625, 'weight': 1, 'content': [{'end': 5541.987, 'text': "So Now let's say that you have a system where customers do register to your system and you need to perform some kind of validation.", 'start': 5529.625, 'duration': 12.362}, {'end': 5545.589, 'text': 'Right So what you would do, for example, would be something like this.', 'start': 5542.187, 'duration': 3.402}, {'end': 5558.039, 'text': 'So inside of your package you would create a class and then customer validator and then service Right.', 'start': 5546.21, 'duration': 11.829}], 'summary': 'Customers register in system, validation performed through package class and customer validator service.', 'duration': 28.414, 'max_score': 5529.625, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI5529625.jpg'}, {'end': 6030.405, 'src': 'embed', 'start': 5966.931, 'weight': 0, 'content': [{'end': 5969.755, 'text': 'And also let me go ahead and remove the plus sign right here.', 'start': 5966.931, 'duration': 2.824}, {'end': 5972.729, 'text': 'There you go.', 'start': 5972.349, 'duration': 0.38}, {'end': 5974.491, 'text': 'Still not valid.', 'start': 5973.37, 'duration': 1.121}, {'end': 5980.255, 'text': "But now you don't know exactly what is wrong with our validation.", 'start': 5974.951, 'duration': 5.304}, {'end': 5989.081, 'text': "So the combinator pattern, it's an awesome design pattern that allows you to chain functions together.", 'start': 5980.855, 'duration': 8.226}, {'end': 5994.945, 'text': 'So basically a combinator is a function that might take other function as arguments.', 'start': 5989.101, 'duration': 5.844}, {'end': 5997.571, 'text': 'and returns new functions.', 'start': 5995.386, 'duration': 2.185}, {'end': 6002.803, 'text': "So this is an awesome pattern that I'm pretty sure that you will love.", 'start': 5998.152, 'duration': 4.651}, {'end': 6005.389, 'text': "And that's what I'm going to teach you next.", 'start': 6003.204, 'duration': 2.185}, {'end': 6018.497, 'text': "All right, let's go ahead and use the combinator pattern to improve this validation service right here that we have.", 'start': 6010.871, 'duration': 7.626}, {'end': 6020.318, 'text': 'So validated service actually.', 'start': 6018.657, 'duration': 1.661}, {'end': 6030.405, 'text': 'So this class right here is okay, but we can do way better than this right?', 'start': 6020.999, 'duration': 9.406}], 'summary': 'Combinator pattern chains functions, improves validation service.', 'duration': 63.474, 'max_score': 5966.931, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI5966931.jpg'}, {'end': 6159.328, 'src': 'embed', 'start': 6122.863, 'weight': 6, 'content': [{'end': 6125.925, 'text': "And let me put this on a new line so you can see exactly what we're doing.", 'start': 6122.863, 'duration': 3.062}, {'end': 6129.667, 'text': 'Now this validation result, this will be an enum.', 'start': 6126.545, 'duration': 3.122}, {'end': 6133.109, 'text': 'So enum and then validation.', 'start': 6129.787, 'duration': 3.322}, {'end': 6135.33, 'text': 'Let me actually just copy and paste this.', 'start': 6133.669, 'duration': 1.661}, {'end': 6137.512, 'text': 'So validation result just like that.', 'start': 6135.551, 'duration': 1.961}, {'end': 6140.294, 'text': 'And now I can import this.', 'start': 6138.613, 'duration': 1.681}, {'end': 6143.576, 'text': 'Oops Actually, I did the right thing.', 'start': 6140.814, 'duration': 2.762}, {'end': 6146.117, 'text': 'And let me actually do a static import right here.', 'start': 6144.116, 'duration': 2.001}, {'end': 6146.938, 'text': 'There we go.', 'start': 6146.137, 'duration': 0.801}, {'end': 6159.328, 'text': "Now here what I'm going to do is have a few results that I want my customer registration validator to have.", 'start': 6147.758, 'duration': 11.57}], 'summary': 'Creating enum validation result for customer registration.', 'duration': 36.465, 'max_score': 6122.863, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI6122863.jpg'}, {'end': 6218.316, 'src': 'embed', 'start': 6190.206, 'weight': 8, 'content': [{'end': 6195.627, 'text': "So the way that we're going to use this with this interface is as follows.", 'start': 6190.206, 'duration': 5.421}, {'end': 6198.828, 'text': 'So this is where combinator pattern kicks off.', 'start': 6195.647, 'duration': 3.181}, {'end': 6202.849, 'text': "So right here we're simply going to have the validations that we want.", 'start': 6199.308, 'duration': 3.541}, {'end': 6209.691, 'text': 'Right So here you can have as many validations as you want, and then you chain them together at the end.', 'start': 6202.989, 'duration': 6.702}, {'end': 6213.113, 'text': "So right here, let's go ahead and simply say static.", 'start': 6210.311, 'duration': 2.802}, {'end': 6218.316, 'text': "And then right here, what we're going to return is this guy right here.", 'start': 6214.153, 'duration': 4.163}], 'summary': 'Using the combinator pattern for multiple validations and chaining them together.', 'duration': 28.11, 'max_score': 6190.206, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI6190206.jpg'}, {'end': 6643.534, 'src': 'heatmap', 'start': 6381.132, 'weight': 0.827, 'content': [{'end': 6387.397, 'text': 'So one final thing that now we have to do is right here we have all of these functions.', 'start': 6381.132, 'duration': 6.265}, {'end': 6394.201, 'text': 'So these three functions and the combinator pattern allows us to chain all of these functions together.', 'start': 6387.477, 'duration': 6.724}, {'end': 6408.832, 'text': 'So the same way that you saw with a function where we can use and then and the same with predicates by using I think it was and right or we can have the same logic with the combinator pattern.', 'start': 6394.522, 'duration': 14.31}, {'end': 6413.134, 'text': "So right here, what I'm going to do here is the following.", 'start': 6409.452, 'duration': 3.682}, {'end': 6416.136, 'text': "So I'm going to have a default method.", 'start': 6413.154, 'duration': 2.982}, {'end': 6419.699, 'text': "And right here I'm going to return a customer valid data.", 'start': 6416.797, 'duration': 2.902}, {'end': 6422.02, 'text': 'So the same thing that we did here.', 'start': 6419.959, 'duration': 2.061}, {'end': 6424.482, 'text': "And then I'm going to say and right.", 'start': 6422.04, 'duration': 2.442}, {'end': 6429.945, 'text': "So right here we're going to take a customer valid data and then I'm going to call other.", 'start': 6425.002, 'duration': 4.943}, {'end': 6433.968, 'text': 'So basically this is where the magic happens.', 'start': 6431.726, 'duration': 2.242}, {'end': 6442.609, 'text': "Right So I'm going to say other and Inside I'm going to return and then customer.", 'start': 6434.328, 'duration': 8.281}, {'end': 6448.753, 'text': "And then inside what I'm going to do is simply say this dot and then apply.", 'start': 6442.629, 'duration': 6.124}, {'end': 6455.798, 'text': "So we are going to apply this customer and I'm going to extract this to a variable.", 'start': 6449.614, 'duration': 6.184}, {'end': 6456.939, 'text': "So I'm going to say result.", 'start': 6455.918, 'duration': 1.021}, {'end': 6459.261, 'text': 'And now check this out.', 'start': 6458.18, 'duration': 1.081}, {'end': 6468.367, 'text': "I'm going to say return and then result dot equals and then success.", 'start': 6459.781, 'duration': 8.586}, {'end': 6478.135, 'text': "So if it is equal to success, I'm going to apply the other validator dot and then apply and then customer.", 'start': 6469.248, 'duration': 8.887}, {'end': 6484.304, 'text': "Otherwise, I'm going to simply pass the actual result, not super result.", 'start': 6479.341, 'duration': 4.963}, {'end': 6486.045, 'text': 'There we go.', 'start': 6485.645, 'duration': 0.4}, {'end': 6490.528, 'text': 'So if we get to this point, we know that we have an error.', 'start': 6486.726, 'duration': 3.802}, {'end': 6495.591, 'text': 'So now this is complaining because I need to pass semi column right here.', 'start': 6491.209, 'duration': 4.382}, {'end': 6500.254, 'text': "So let's go ahead now and use this awesome interface.", 'start': 6496.652, 'duration': 3.602}, {'end': 6504.297, 'text': "So let's go back to the main method right here.", 'start': 6500.875, 'duration': 3.422}, {'end': 6508.422, 'text': 'And now let me simply comment this out.', 'start': 6505.439, 'duration': 2.983}, {'end': 6512.686, 'text': 'And let me simply add an ad sign right here.', 'start': 6509.103, 'duration': 3.583}, {'end': 6515.809, 'text': 'Actually, let me simply leave it as it is.', 'start': 6512.706, 'duration': 3.103}, {'end': 6518.051, 'text': "And then I'm going to show you exactly all the errors.", 'start': 6516.129, 'duration': 1.922}, {'end': 6523.696, 'text': "So now let's go ahead and simply say customer actually not here.", 'start': 6518.611, 'duration': 5.085}, {'end': 6532.691, 'text': 'So using Combinator pattern.', 'start': 6523.716, 'duration': 8.975}, {'end': 6541.957, 'text': "So right here, let's go ahead and say customer registration validator and then dot and check this out.", 'start': 6533.392, 'duration': 8.565}, {'end': 6549.101, 'text': 'So we have all of these methods, right? Is an adult is email valid and is phone number valid.', 'start': 6542.017, 'duration': 7.084}, {'end': 6558.44, 'text': 'So let me go ahead and simply start with is email valid, right? But now what I want to do is the following.', 'start': 6549.721, 'duration': 8.719}, {'end': 6564.162, 'text': "So right here I'm going to say dot and then check this out.", 'start': 6559.12, 'duration': 5.042}, {'end': 6565.642, 'text': 'We have this method.', 'start': 6564.182, 'duration': 1.46}, {'end': 6567.183, 'text': 'So and right here.', 'start': 6565.682, 'duration': 1.501}, {'end': 6569.223, 'text': 'So this is the one that we defined.', 'start': 6567.543, 'duration': 1.68}, {'end': 6572.384, 'text': "So I'm going to say and then let's use the rest.", 'start': 6569.243, 'duration': 3.141}, {'end': 6578.686, 'text': 'So if I press control shift, you can see that we have the other methods.', 'start': 6572.624, 'duration': 6.062}, {'end': 6585.959, 'text': 'So is phone number valid dot and then and And then is an adult.', 'start': 6579.247, 'duration': 6.712}, {'end': 6587.201, 'text': 'There we go.', 'start': 6586.72, 'duration': 0.481}, {'end': 6595.694, 'text': 'So if I now add a static import, you can see that now this becomes much cleaner.', 'start': 6587.942, 'duration': 7.752}, {'end': 6602.562, 'text': 'So now We have these three methods that we have chained together.', 'start': 6596.395, 'duration': 6.167}, {'end': 6608.744, 'text': 'The way that we use it is simply by saying dot and then apply and then pass customer.', 'start': 6603.182, 'duration': 5.562}, {'end': 6609.985, 'text': 'There we go.', 'start': 6609.425, 'duration': 0.56}, {'end': 6612.346, 'text': 'Now if I extract this to a variable.', 'start': 6610.725, 'duration': 1.621}, {'end': 6613.807, 'text': 'So result.', 'start': 6612.966, 'duration': 0.841}, {'end': 6618.049, 'text': "And let's go ahead and simply say south and then result.", 'start': 6614.707, 'duration': 3.342}, {'end': 6626.293, 'text': "So now what I'm going to do here is say if and then result.", 'start': 6619.91, 'duration': 6.383}, {'end': 6630.828, 'text': 'not equals to success.', 'start': 6628.167, 'duration': 2.661}, {'end': 6634.95, 'text': "So success we're going to throw.", 'start': 6631.208, 'duration': 3.742}, {'end': 6636.491, 'text': "So let's throw.", 'start': 6634.97, 'duration': 1.521}, {'end': 6641.413, 'text': 'So throw new illegal state exception.', 'start': 6637.871, 'duration': 3.542}, {'end': 6643.534, 'text': 'You could have your own exception.', 'start': 6642.013, 'duration': 1.521}], 'summary': 'Using the combinator pattern to chain functions for customer validation.', 'duration': 262.402, 'max_score': 6381.132, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI6381132.jpg'}, {'end': 6541.957, 'src': 'embed', 'start': 6509.103, 'weight': 5, 'content': [{'end': 6512.686, 'text': 'And let me simply add an ad sign right here.', 'start': 6509.103, 'duration': 3.583}, {'end': 6515.809, 'text': 'Actually, let me simply leave it as it is.', 'start': 6512.706, 'duration': 3.103}, {'end': 6518.051, 'text': "And then I'm going to show you exactly all the errors.", 'start': 6516.129, 'duration': 1.922}, {'end': 6523.696, 'text': "So now let's go ahead and simply say customer actually not here.", 'start': 6518.611, 'duration': 5.085}, {'end': 6532.691, 'text': 'So using Combinator pattern.', 'start': 6523.716, 'duration': 8.975}, {'end': 6541.957, 'text': "So right here, let's go ahead and say customer registration validator and then dot and check this out.", 'start': 6533.392, 'duration': 8.565}], 'summary': 'Demonstrating the combinator pattern with customer registration validator.', 'duration': 32.854, 'max_score': 6509.103, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI6509103.jpg'}], 'start': 5462.533, 'title': 'Combinator design pattern', 'summary': "Introduces the combinator design pattern and demonstrates its implementation using a customer validator service for email, phone number, and date of birth validation, and showcases the usage of the customer validator service for validating customer data. it also discusses the implementation of a validator service for customer data, enabling validation of email, phone number, and age, with the ability to store valid customers in a database. additionally, it covers the application of the combinator pattern for validation, creating a beautiful interface to chain validations together and reduce code duplication. furthermore, it explains the implementation of the combinator pattern for customer validation, demonstrating the chaining of validation methods and the lazy evaluation feature, resulting in successfully validating a customer's details and throwing exceptions for invalid inputs.", 'chapters': [{'end': 5754.854, 'start': 5462.533, 'title': 'Combinator design pattern', 'summary': 'Introduces the combinator design pattern and demonstrates its implementation using a customer validator service to perform email, phone number, and date of birth validation for a customer. it also showcases the usage of the customer validator service for validating customer data.', 'duration': 292.321, 'highlights': ['The chapter introduces the Combinator design pattern and demonstrates its implementation using a customer validator service.', 'The implementation includes email, phone number, and date of birth validation for a customer.', 'Showcases the usage of the customer validator service for validating customer data.']}, {'end': 5966.17, 'start': 5754.954, 'title': 'Validator service implementation', 'summary': 'Demonstrates the implementation of a validator service for customer data, enabling validation of email, phone number, and age, with the ability to store valid customers in a database.', 'duration': 211.216, 'highlights': ['The implementation of a validator service for customer data enables checking the validity of customer information, including email, phone number, and age, improving data integrity and customer management.', 'The code demonstrates the use of functions to streamline the validation process, enhancing efficiency and maintainability of the validation service.', 'The validator service allows for immediate validation of customer data, leading to efficient decision-making processes and enabling the storage of valid customer data in a database for future use.']}, {'end': 6416.136, 'start': 5966.931, 'title': 'Combinator pattern for validation', 'summary': 'Discusses the application of the combinator pattern for validation, where a chain of functions is used to improve the validation service, creating a beautiful interface to chain validations together and reduce code duplication.', 'duration': 449.205, 'highlights': ['The combinator pattern allows chaining of functions to create a more efficient and elegant validation service, reducing code duplication.', 'The chapter introduces the creation of a registration validator interface using the combinator pattern, extending a function and returning a validation result, enabling multiple validations to be chained together.', 'The use of enums and static imports to define validation results, such as success and different error messages, is demonstrated for the registration validator interface.']}, {'end': 6904.982, 'start': 6416.797, 'title': 'Combinator pattern for customer validation', 'summary': "Explains the implementation of the combinator pattern for customer validation, demonstrating the chaining of validation methods and the lazy evaluation feature, resulting in successfully validating a customer's details and throwing exceptions for invalid inputs.", 'duration': 488.185, 'highlights': ["The Combinator pattern is demonstrated by chaining validation methods such as isEmailValid, isPhoneNumberValid, and isAdult, and applying the validation to a customer, resulting in successfully validating the customer's details and throwing exceptions for invalid inputs.", 'The lazy evaluation feature of the Combinator pattern is highlighted, showcasing that none of the validation methods are executed until the dot apply method is invoked, thereby enabling efficient and on-demand validation of customer details.', 'The power of the Combinator pattern is emphasized, allowing for easy customization and adaptation to changing requirements by duplicating and implementing custom logic within the defined interface for customer registration validation.']}], 'duration': 1442.449, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI5462533.jpg', 'highlights': ['The combinator pattern allows chaining of functions to create a more efficient and elegant validation service, reducing code duplication.', 'The implementation of a validator service for customer data enables checking the validity of customer information, including email, phone number, and age, improving data integrity and customer management.', "The Combinator pattern is demonstrated by chaining validation methods such as isEmailValid, isPhoneNumberValid, and isAdult, and applying the validation to a customer, resulting in successfully validating the customer's details and throwing exceptions for invalid inputs.", 'The chapter introduces the Combinator design pattern and demonstrates its implementation using a customer validator service.', 'The code demonstrates the use of functions to streamline the validation process, enhancing efficiency and maintainability of the validation service.', 'The lazy evaluation feature of the Combinator pattern is highlighted, showcasing that none of the validation methods are executed until the dot apply method is invoked, thereby enabling efficient and on-demand validation of customer details.', 'The use of enums and static imports to define validation results, such as success and different error messages, is demonstrated for the registration validator interface.', 'Showcases the usage of the customer validator service for validating customer data.', 'The chapter introduces the creation of a registration validator interface using the combinator pattern, extending a function and returning a validation result, enabling multiple validations to be chained together.', 'The validator service allows for immediate validation of customer data, leading to efficient decision-making processes and enabling the storage of valid customer data in a database for future use.']}, {'end': 7371.601, 'segs': [{'end': 6938.632, 'src': 'embed', 'start': 6905.582, 'weight': 0, 'content': [{'end': 6908.946, 'text': 'If you have any questions, go ahead and drop me a message.', 'start': 6905.582, 'duration': 3.364}, {'end': 6911.128, 'text': "Otherwise, let's move on.", 'start': 6909.586, 'duration': 1.542}, {'end': 6916.985, 'text': 'All right.', 'start': 6916.604, 'duration': 0.381}, {'end': 6918.447, 'text': 'So, in this final section,', 'start': 6917.065, 'duration': 1.382}, {'end': 6928.903, 'text': 'let me go ahead and explain a few things that will help you to fully understand the functional interfaces and functional programming with Java.', 'start': 6918.447, 'duration': 10.456}, {'end': 6930.946, 'text': 'So go ahead and create a new package.', 'start': 6929.323, 'duration': 1.623}, {'end': 6938.632, 'text': "And in this package, we're going to call it as final and then section right here.", 'start': 6932.067, 'duration': 6.565}], 'summary': 'Explaining functional interfaces and programming with java in final section', 'duration': 33.05, 'max_score': 6905.582, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI6905582.jpg'}, {'end': 7126.202, 'src': 'embed', 'start': 7101.898, 'weight': 3, 'content': [{'end': 7108.965, 'text': 'So basically you can see that this callback right here is a function and you can have a lot of logic in it.', 'start': 7101.898, 'duration': 7.067}, {'end': 7111.767, 'text': 'Right But this is very simple.', 'start': 7109.285, 'duration': 2.482}, {'end': 7112.848, 'text': "So we're just logging.", 'start': 7111.847, 'duration': 1.001}, {'end': 7120.817, 'text': 'But if you want to have, for example, an extra logic that goes to the database and does some other stuff, you could definitely do it.', 'start': 7112.928, 'duration': 7.889}, {'end': 7123.5, 'text': "I'm just showing you the callbacks in JavaScript.", 'start': 7120.877, 'duration': 2.623}, {'end': 7126.202, 'text': 'So right here, if I now pass.', 'start': 7123.96, 'duration': 2.242}], 'summary': 'Introduction to javascript callbacks with potential for more complex logic and database interactions.', 'duration': 24.304, 'max_score': 7101.898, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI7101898.jpg'}, {'end': 7183.429, 'src': 'embed', 'start': 7153.256, 'weight': 1, 'content': [{'end': 7154.637, 'text': 'So you have it for reference.', 'start': 7153.256, 'duration': 1.381}, {'end': 7159.919, 'text': "So now what I'm going to do is actually have a static and then void.", 'start': 7155.257, 'duration': 4.662}, {'end': 7167.262, 'text': "And right here, what I'm going to do is actually combine both worlds so we can have a regular method.", 'start': 7160.419, 'duration': 6.843}, {'end': 7168.742, 'text': 'So normal Java method.', 'start': 7167.282, 'duration': 1.46}, {'end': 7173.445, 'text': 'And also inside as a parameter, we can have a function.', 'start': 7169.683, 'duration': 3.762}, {'end': 7178.407, 'text': 'Right So this is programming because now we are free to do whatever we want.', 'start': 7173.685, 'duration': 4.722}, {'end': 7180.908, 'text': 'So right here you see static void.', 'start': 7178.927, 'duration': 1.981}, {'end': 7183.429, 'text': "And then let's go ahead and simply say hello.", 'start': 7181.408, 'duration': 2.021}], 'summary': 'Combining static and void to create a regular java method with a function parameter.', 'duration': 30.173, 'max_score': 7153.256, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI7153256.jpg'}, {'end': 7238.026, 'src': 'embed', 'start': 7211.257, 'weight': 2, 'content': [{'end': 7218.263, 'text': "that might take, for example, last name if it's there printed, otherwise have, for example, a default message.", 'start': 7211.257, 'duration': 7.006}, {'end': 7226.05, 'text': "So right here, what we're going to do is simply say consumer and then of type and then string.", 'start': 7218.724, 'duration': 7.326}, {'end': 7231.254, 'text': "And then let's simply name this as call back just like that.", 'start': 7227.771, 'duration': 3.483}, {'end': 7233.202, 'text': 'There we go.', 'start': 7232.742, 'duration': 0.46}, {'end': 7238.026, 'text': 'And then right here, let me simply say South and then first name.', 'start': 7233.623, 'duration': 4.403}], 'summary': 'Creating a consumer callback with last name and default message, as well as first name.', 'duration': 26.769, 'max_score': 7211.257, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI7211257.jpg'}], 'start': 6905.582, 'title': 'Java functional interfaces and programming', 'summary': 'Discusses the concept of functional interfaces and programming in java, explaining callbacks, showcasing an example with console logs and functions, and demonstrating a method that combines a regular java method with a parameterized function for flexible behavior.', 'chapters': [{'end': 7126.202, 'start': 6905.582, 'title': 'Understanding functional interfaces in java', 'summary': 'Discusses how to understand functional interfaces and functional programming with java, explaining the concept of callbacks in javascript and showcasing an example with console logs and functions.', 'duration': 220.62, 'highlights': ['The chapter explains the concept of callbacks in JavaScript, demonstrating a function with console logs and how callbacks can be used for additional logic and functionality.', 'The speaker provides an example of a callback function in JavaScript, showcasing how it can be used to handle scenarios where certain parameters are not provided.', 'The speaker demonstrates how a callback function can be invoked and used in JavaScript, emphasizing its flexibility and potential for handling various types of logic and functionality.']}, {'end': 7371.601, 'start': 7126.483, 'title': 'Java functional programming example', 'summary': 'Discusses using functional programming and functional interfaces in java, showcasing a static void method that combines a regular java method with a parameterized function, allowing for flexible behavior based on input.', 'duration': 245.118, 'highlights': ['The chapter demonstrates using functional programming and functional interfaces in Java to achieve flexible behavior based on input.', 'A static void method is presented that combines a regular Java method with a parameterized function, allowing for customized handling of input values.', 'An example showcases using a consumer of type string to handle last name input, providing a default message if no last name is provided.']}], 'duration': 466.019, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI6905582.jpg', 'highlights': ['The chapter demonstrates using functional programming and functional interfaces in Java to achieve flexible behavior based on input.', 'A static void method is presented that combines a regular Java method with a parameterized function, allowing for customized handling of input values.', 'An example showcases using a consumer of type string to handle last name input, providing a default message if no last name is provided.', 'The chapter explains the concept of callbacks in JavaScript, demonstrating a function with console logs and how callbacks can be used for additional logic and functionality.', 'The speaker provides an example of a callback function in JavaScript, showcasing how it can be used to handle scenarios where certain parameters are not provided.', 'The speaker demonstrates how a callback function can be invoked and used in JavaScript, emphasizing its flexibility and potential for handling various types of logic and functionality.']}, {'end': 8497.772, 'segs': [{'end': 7396.795, 'src': 'embed', 'start': 7371.601, 'weight': 2, 'content': [{'end': 7385.991, 'text': 'I just want to show you that you can combine a normal function with these functional interfaces and do stuff like this and achieve a similar concept as JavaScript that they call callbacks.', 'start': 7371.601, 'duration': 14.39}, {'end': 7389.692, 'text': 'So there are other languages that have the similar concept.', 'start': 7386.151, 'duration': 3.541}, {'end': 7396.795, 'text': 'But JavaScript, you see a lot of these callbacks being thrown, and you can pretty much do the same with functions.', 'start': 7390.112, 'duration': 6.683}], 'summary': 'Combining normal function with functional interfaces to achieve callback concept similar to javascript.', 'duration': 25.194, 'max_score': 7371.601, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI7371601.jpg'}, {'end': 7514.333, 'src': 'embed', 'start': 7481.845, 'weight': 3, 'content': [{'end': 7483.987, 'text': 'If you have any questions, go ahead and drop me a message.', 'start': 7481.845, 'duration': 2.142}, {'end': 7485.608, 'text': "Otherwise, let's move on.", 'start': 7484.487, 'duration': 1.121}, {'end': 7493.285, 'text': 'Let me go ahead and teach you about lambdas.', 'start': 7491.104, 'duration': 2.181}, {'end': 7499.327, 'text': "So we've been using lambdas throughout this course with all these functions.", 'start': 7493.925, 'duration': 5.402}, {'end': 7501.928, 'text': "But basically, let me show you exactly how they're used.", 'start': 7499.467, 'duration': 2.461}, {'end': 7509.691, 'text': 'And for example, if you only have one return statement, if you have two arguments, what you should do when using lambdas.', 'start': 7502.588, 'duration': 7.103}, {'end': 7514.333, 'text': "So let's go ahead and expand this.", 'start': 7510.331, 'duration': 4.002}], 'summary': 'Teaching about lambdas with examples and guidelines.', 'duration': 32.488, 'max_score': 7481.845, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI7481845.jpg'}, {'end': 7914.9, 'src': 'embed', 'start': 7885.661, 'weight': 4, 'content': [{'end': 7895.724, 'text': 'but when you use these functional interfaces, you see right here where you define the actual inputs and outputs of functions, right?', 'start': 7885.661, 'duration': 10.063}, {'end': 7898.725, 'text': 'So string and an integer and a string.', 'start': 7895.744, 'duration': 2.981}, {'end': 7904.587, 'text': 'So these right here, they have to be the object type and not the primitive.', 'start': 7899.445, 'duration': 5.142}, {'end': 7906.569, 'text': 'So, for example, integer.', 'start': 7905.087, 'duration': 1.482}, {'end': 7909.833, 'text': 'Right So you could have an integer like this.', 'start': 7906.81, 'duration': 3.023}, {'end': 7914.9, 'text': 'So integer and then number equals to no.', 'start': 7910.695, 'duration': 4.205}], 'summary': 'Using functional interfaces, define inputs and outputs of functions with object types, not primitives.', 'duration': 29.239, 'max_score': 7885.661, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI7885661.jpg'}, {'end': 8033.77, 'src': 'embed', 'start': 8004.096, 'weight': 6, 'content': [{'end': 8009.077, 'text': 'But if I remove the static keyword, you can see that it does not work.', 'start': 8004.096, 'duration': 4.981}, {'end': 8016.44, 'text': "Right So this is something that to bear in mind, your functions and by functions, they don't have to be static.", 'start': 8010.117, 'duration': 6.323}, {'end': 8021.783, 'text': 'Right In fact, having static throughout your code base is not practical.', 'start': 8016.741, 'duration': 5.042}, {'end': 8026.986, 'text': 'So ideally, what you would do is simply have, for example.', 'start': 8022.244, 'duration': 4.742}, {'end': 8031.448, 'text': "So let's say that you have a let me actually put this inside.", 'start': 8027.326, 'duration': 4.122}, {'end': 8033.77, 'text': 'So just like that.', 'start': 8032.549, 'duration': 1.221}], 'summary': 'Avoid excessive use of static keyword in functions for better code practicality.', 'duration': 29.674, 'max_score': 8004.096, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI8004096.jpg'}, {'end': 8097.583, 'src': 'embed', 'start': 8072.774, 'weight': 5, 'content': [{'end': 8079.336, 'text': 'You can also change this to private or no access modifier at all.', 'start': 8072.774, 'duration': 6.562}, {'end': 8080.777, 'text': 'So this is package protected.', 'start': 8079.356, 'duration': 1.421}, {'end': 8087.379, 'text': "Right So just to bear in mind that They don't have to be static and you should avoid static.", 'start': 8081.057, 'duration': 6.322}, {'end': 8095.802, 'text': "But the reason why I've been using static is because I've been doing everything inside of this public static void main method.", 'start': 8087.519, 'duration': 8.283}, {'end': 8097.583, 'text': 'So there we go.', 'start': 8096.822, 'duration': 0.761}], 'summary': 'Discussion on using non-static access modifiers and avoiding static in the main method.', 'duration': 24.809, 'max_score': 8072.774, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI8072774.jpg'}, {'end': 8209.469, 'src': 'embed', 'start': 8151.851, 'weight': 0, 'content': [{'end': 8155.592, 'text': "So pure functions don't depend on global state.", 'start': 8151.851, 'duration': 3.741}, {'end': 8158.773, 'text': 'Impure functions do depend on global state.', 'start': 8156.012, 'duration': 2.761}, {'end': 8162.556, 'text': 'And that comes with the side effects right?', 'start': 8159.493, 'duration': 3.063}, {'end': 8172.745, 'text': 'So your functions should have no side effects other than everything inside of the body of your function, right?', 'start': 8162.636, 'duration': 10.109}, {'end': 8180.352, 'text': "It shouldn't have a side effect outside of the function and also higher all the functions.", 'start': 8172.885, 'duration': 7.467}, {'end': 8184.635, 'text': 'So a function is considered to be higher or the function is.', 'start': 8180.532, 'duration': 4.103}, {'end': 8191.219, 'text': 'If one of these two conditions are met, the function takes one or more functions as parameters.', 'start': 8185.496, 'duration': 5.723}, {'end': 8198.304, 'text': 'So we saw how to pass functions inside a normal functions.', 'start': 8191.66, 'duration': 6.644}, {'end': 8203.627, 'text': 'Right Or if the function returns another function as result.', 'start': 8198.744, 'duration': 4.883}, {'end': 8207.169, 'text': "So with the combinator pattern, that's exactly what we've done.", 'start': 8203.707, 'duration': 3.462}, {'end': 8208.25, 'text': 'So let me actually show you.', 'start': 8207.388, 'duration': 0.862}, {'end': 8209.469, 'text': 'So right here.', 'start': 8208.87, 'duration': 0.599}], 'summary': 'Pure functions have no side effects and can be higher-order functions.', 'duration': 57.618, 'max_score': 8151.851, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI8151851.jpg'}, {'end': 8464.341, 'src': 'embed', 'start': 8439.247, 'weight': 1, 'content': [{'end': 8448.691, 'text': "because once you combine everything that you've learned in this course with Java Streams, you will start to write code that really really shines.", 'start': 8439.247, 'duration': 9.444}, {'end': 8458.295, 'text': 'Instead of you writing code that takes, for example, 20 lines of code, you simply take five lines of code with streams and functional interfaces.', 'start': 8449.331, 'duration': 8.964}, {'end': 8460.537, 'text': 'So this is all for now.', 'start': 8459.176, 'duration': 1.361}, {'end': 8464.341, 'text': 'Go ahead and subscribe to my channel to get more videos like this.', 'start': 8461.098, 'duration': 3.243}], 'summary': 'Learn to write efficient java code with streams, reducing 20 lines to 5.', 'duration': 25.094, 'max_score': 8439.247, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI8439247.jpg'}], 'start': 7371.601, 'title': 'Functional programming in java', 'summary': 'Covers combining functional interfaces with normal functions, usage of lambdas, functional interfaces, and rules of functional programming, emphasizing pure functions, no side effects, and benefits of combining with java streams api.', 'chapters': [{'end': 7857.565, 'start': 7371.601, 'title': 'Combining functional interfaces and normal functions', 'summary': 'Discusses combining functional interfaces with normal functions to achieve a similar concept as javascript callbacks, illustrating the use of lambdas and by functions with detailed examples and explanations.', 'duration': 485.964, 'highlights': ['The chapter discusses combining functional interfaces with normal functions to achieve a similar concept as JavaScript callbacks.', 'Illustrating the use of lambdas and by functions with detailed examples and explanations.']}, {'end': 8097.583, 'start': 7858.386, 'title': 'Lambda functions and functional interfaces', 'summary': 'Explains the usage of lambdas, functional interfaces, and the limitations of using primitive types, emphasizing the importance of avoiding static methods in functions.', 'duration': 239.197, 'highlights': ['The chapter explains the usage of lambdas and different ways to use functional interfaces with object types, emphasizing the limitations of using primitive types like integer.', 'The importance of avoiding static methods in functions is emphasized, and the example demonstrates the impact of removing the static keyword on the functionality.', 'The recommendation to avoid using static methods throughout the codebase is provided, and the practicality of using public, private, or package-protected interfaces is explained.']}, {'end': 8497.772, 'start': 8097.823, 'title': 'Functional programming rules and higher order functions', 'summary': 'Covers the rules of functional programming, emphasizing the importance of pure functions, no side effects, and higher order functions, along with the benefits of combining functional programming with java streams api.', 'duration': 399.949, 'highlights': ['The importance of pure functions and no side effects', 'Higher order functions and their conditions', 'Benefits of combining functional programming with Java Streams API']}], 'duration': 1126.171, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/rPSL1alFIjI/pics/rPSL1alFIjI7371601.jpg', 'highlights': ['The importance of pure functions and no side effects', 'Benefits of combining functional programming with Java Streams API', 'The chapter discusses combining functional interfaces with normal functions to achieve a similar concept as JavaScript callbacks', 'Illustrating the use of lambdas and by functions with detailed examples and explanations', 'The chapter explains the usage of lambdas and different ways to use functional interfaces with object types, emphasizing the limitations of using primitive types like integer', 'The recommendation to avoid using static methods throughout the codebase is provided, and the practicality of using public, private, or package-protected interfaces is explained', 'The importance of avoiding static methods in functions is emphasized, and the example demonstrates the impact of removing the static keyword on the functionality', 'Higher order functions and their conditions']}], 'highlights': ['Covers the differences between imperative and declarative programming, emphasizing the shift away from imperative programming.', 'The combinator pattern allows chaining of functions to create a more efficient and elegant validation service, reducing code duplication.', 'The chapter introduces the Combinator design pattern and demonstrates its implementation using a customer validator service.', 'The chapter emphasizes the benefits of functional programming techniques, including streams and optionals, in writing more efficient and concise Java code, providing a path for developers to enhance their skills and productivity.', 'The Java Util Function package provides functional interfaces for Lambda expressions and method references, including predicates, consumers, and functions, used in stream operations, to enhance understanding of functional programming in Java.', 'The process of chaining two functions together to produce a calculated result is demonstrated, showcasing the concept of combining multiple functions to achieve a desired output, yielding an example result of 20.', 'The chapter covers the concept of Consumer in Java', 'The chapter demonstrates using functional programming and functional interfaces in Java to achieve flexible behavior based on input.', 'The importance of pure functions and no side effects', "The chapter emphasizes the difference between 'and' and 'or' logical operators, highlighting that 'or' means either one of the conditions is true, while 'and' requires all conditions to be true."]}