This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<User> usersList = Arrays.asList( | |
new User("Alice", "Darvin", 28), | |
new User("Bob", "Cooper", 35), | |
new User("Jessika", "Davies", 18), | |
new User("Albert ", "Downing", 58), | |
new User("Luke", "Morgan", 23) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sample.streams; | |
public class User { | |
private String firstName; | |
private String lastName; | |
private Integer age; | |
public User(String firstName, String lastName, Integer age) { | |
this.firstName = firstName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.Consumer; | |
public class Main { | |
public static void main(String[] args) { | |
Consumer<String> lambda = s1 -> System.out.println("Hi " + s1); | |
lambda.accept("Alice"); //Output : "Hi Alice" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.lambdaSample.SampleFunctionalInterface; | |
public class Main { | |
public static void main(String[] args) { | |
SampleFunctionalInterface lambda = s1 -> System.out.println("Hi " + s1); | |
lambda.foo("Alice"); //Output : "Hi Alice" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.Function; | |
public class Main { | |
public static void main(String[] args) { | |
Function<String, Integer> lambda = a -> a.length(); | |
System.out.println(lambda.apply("MyString")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void uploadToFTP(MultipartFile file, String baseDirectory, String scanDirectory) | |
throws ScanManagerException { | |
FTPClient client = new FTPClient(); | |
FileInputStream fis = null; | |
try { | |
client.connect("host","port"); | |
client.login("username","password"); | |
if (client.isConnected()) { | |
boolean directoryExists = client.changeWorkingDirectory(baseDirectory + File.separator + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** ECDH ServerKeyExchange | |
Signature Algorithm SHA256withRSA | |
Server key: Sun EC public key, 256 bits | |
public x coord: 49880139518100326927648337356136531406906846853753693344570844017045565963249 | |
public y coord: 95714017526253024568876509155195989984116809887282783483716821451591048546410 | |
parameters: secp256r1 [NIST P-256, X9.62 prime256v1] (1.2.840.10045.3.1.7) |
NewerOlder