Monday, 15 July 2019

java stream api manupalation for arraylist of integer to comma sepertaed

import java.util.*;
import java.util.stream.Collectors;
class Main {
  public static void main(String[] args) {
   List<String> strings = new LinkedList<>();
     strings.add("Java");strings.add("is");
     strings.add("cool");
     String message = String.join(", ", strings);
     System.out.println(message);

      List<Integer> num = new LinkedList<>();
     num.add(2);
     num.add(5);
     num.add(7);
     String message1 =num.stream().map((gameId)-> gameId.toString()).collect(Collectors.joining(","));
     System.out.println(message1);
     //message returned is: "Java is cool"

  }
}
https://www.baeldung.com/java-string-with-separator-to-list

Friday, 12 July 2019

s3 bucket naming convention

The legacy rules for bucket names in the US East (N. Virginia) Region allowed bucket names to be as long as 255 characters, and bucket names could contain any combination of uppercase letters, lowercase letters, numbers, periods (.), hyphens (-), and underscores (_).