Finished after code review and added into the build-all.sh script
This commit is contained in:
@@ -86,6 +86,7 @@ if [[ "$MODULE" == "module6" ]]
|
||||
then
|
||||
# ADD NEW MODULES HERE
|
||||
# (add new modules above the rest so you get quicker feedback if it fails)
|
||||
build_maven_module "immutables"
|
||||
build_maven_module "core-java/versions"
|
||||
build maven_module "java-hashes"
|
||||
build maven_module "http-clients"
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.reflectoring.io.immutables.optionalAndDefault;
|
||||
|
||||
import org.immutables.value.Value;
|
||||
|
||||
@Value.Immutable
|
||||
interface DefaultArticleInterface {
|
||||
|
||||
Long getId();
|
||||
|
||||
@Value.Default
|
||||
default String getTitle(){
|
||||
return "Default title!";
|
||||
}
|
||||
|
||||
String getContent();
|
||||
|
||||
}
|
||||
@@ -8,10 +8,16 @@ public class OptionalAndDefaultService {
|
||||
OptionalArticle article = ImmutableOptionalArticle.builder().build();
|
||||
DefaultArticle defaultArticle = ImmutableDefaultArticle.builder()
|
||||
.id(0l)
|
||||
.content("Lorem ipsum content!")
|
||||
.content("Lorem ipsum!")
|
||||
.build();
|
||||
|
||||
System.out.println(article);
|
||||
DefaultArticleInterface defaultArticleInterface =
|
||||
ImmutableDefaultArticleInterface.builder()
|
||||
.id(0l)
|
||||
.content("Lorem ipsum!")
|
||||
.build();
|
||||
|
||||
System.out.println(defaultArticle);
|
||||
System.out.println(defaultArticleInterface);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user