java.util.Optional.ofNullable(T) The method Optional.ofNullable(T) returns Optional containing given value if it was not null or an empty Optional in case of null value.
java.util.Map.replaceAll(BiFunction) The method Map.replaceAll(BiFunction) replaces each value with the result of applying the given function on the corresponding entry. Rethrows exceptions thrown by the replacement function.
Spring field injection This is probably the most common form of Dependency Injection, because it reduces a lot of boilerplate code needed with setter or constructor injections.
java.util.Map.replace(key, oldValue, newValue) The method Map.replace(key, oldValue, newValue) replaces the value associated with the given key only if it is currently mapped to the oldValue.
java.util.Map.replace(key, value) The method Map.replace(key, value) associates the given value with the given key only when the map already contains such key.
Java.Util.Map.remove(key, value) The method Map.remove(Object key, Object value) removes entry for the key when its current mapping is equal to the given value.
java.util.Map.putIfAbsent(key, value) The method Map.putIfAbsent(key, value) associates the given key with the given value if there is no such association or the current value in map is null. Returns null or the previous value.
The java.time.Clock class provides access to the current instant, date and time using a time-zone. These are the main properties of the class: Use of the Clock class is optional, because all key date-time classes have a now() factory method that uses the system clock in the default time zone. Use Dependency Injection framework to …
Spring Setter Injection This form of Dependency Injection is used very often, especially for optional dependencies and reconfigurable beans. We’ll show how to use it using Spring annotations.
In Java Lang Tutorial you will learn handy features of classes from java.lang package! Java Lang Classes Java Objects equals hashcode Shows how to use (new in Java 7) Objects to implement equals and hashcode. Java null check Shows how to validate input using (new in Java 7) Objects class. Java external process How to …