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
provider "aws" { | |
region = var.region | |
default_tags { | |
tags = { | |
Environment = "Development" | |
} | |
} | |
} |
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
variable "region" { | |
description = "AWS Region" | |
default = "eu-central-1" | |
type = string | |
} | |
variable "namespace" { | |
description = "Project namespace" | |
type = string | |
} |
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
namespace = "dev" | |
region = "eu-central-1" | |
project_name = "terrenv" | |
ssh_key = "my_public_ssh_key" |
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
BinaryOperator<Integer> binaryOperator = (a, b) -> a * b; | |
binaryOperator.apply(3, 5); |
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
Consumer<String> consumer = in -> System.out.println(in); | |
consumer.accept("Hello World"); |
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
void printWhenLT(int value, Predicate<Integer> testValue) { | |
if (testValue.test(value)) { | |
System.out.println(value); | |
} | |
} | |
Predicate<Integer> lt10 = value -> value < 10; | |
Predicate<Integer> lt20 = value -> value < 20; | |
printWhenLT(5, lt10); |
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
Supplier<String> strSupplier = () -> "Hello world"; | |
String str = strSupplier.get(); |
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
void effectivelyFinal() { | |
int count = 10; | |
Converter<Integer, String> converter = from -> String.valueOf(from * count); | |
System.out.println(converter.convert(10)); | |
//count++; | |
} |
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
Converter<String, Integer> fnConverter = (String from) -> Integer.valueOf(from); | |
System.out.println(fnConverter.convert("10")); | |
Converter<String, Integer> rfConverter = Integer::valueOf; | |
System.out.println(rfConverter.convert("10")); |
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
Converter<String, Integer> converter = new Converter<String, Integer>() { | |
@Override | |
public Integer convert(String from) { | |
return Integer.valueOf(from); | |
} | |
}; | |
System.out.println(converter.convert("10")); |
NewerOlder