ArrayList to HashMap in java

ArrayList is a dynamic array.As we discussed in pervious post, ArrayList is slower than arrays but there is no restriction on size.Based on requirement, we can keep growing the elements in the list. HasMap is used for storing Key/Value as elements.But order of the elements is the same as we store the elements in it.Since … Read more

MapStruct – Easy & fast way to map Java beans

import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.factory.Mappers; class Employee { Employee(int id, String name, String email) { this.id = id; this.employeeName = name; this.email = email; } private int id; private String employeeName; private String email; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getEmployeeName() { … Read more

Amazon S3 Glacier: What Is It and How to Use It and its Storage Classes

Amazon S3 Glacier S3 provides various storage classes so we need to understand which storage type is suitable for a given situation. Since requirement can be of different types like sometimes we need to frequently access the data or sometimes we data needed is infrequent but need to be accessed without delay. So based on … Read more

Identity and Access Management (IAM) in Amazon Web Services (AWS)

AWS Identity and Access Management (IAM) service controls the access for various AWS resources.  We can provide or restrict access to certain users who can use particular AWS resource. AWS Components:   1) Users: IAM user is the entity by which we can access AWS services and resources.By default we get root user for using … Read more

What is Predicate Functional Interface in Java 8

Predicate in Java 8 The Predicate is one of the Functional Interfaces type introduced in Java 8. Generally predicate means a statement that determines if a value could be true or false. So predicate is used to test a condition which will return a boolean value. Syntax: @FunctionalInterface public interface Predicate { boolean test(T t); … Read more

Java 8 BiFunction Examples

Java 8 BiFunction BiFunction is a functional interface introduced in Java 8.BiFunction interface’s method takes two parameter (T and U ) and returns one parameter(R) as output. Syntax: @FunctionalInterface public interface BiFunction { R apply(T t, U u); } T: Type of the first argument to the function U: Type of the second argument to … Read more

Functional Interfaces in Java

Functional Interfaces in Java In Java, being an object oriented programming language, everything revolves around Objects and classes.If we want to write a simple one statement for displaying a message using System.out.print then also we need to write a class to have such method.Means we can’t write any function/method without writing a class in java. … Read more