BAEL-2990 Automatic generation of the Builder pattern with FreeBuilder
This commit is contained in:
parent
b467ee6ac2
commit
d45e50fa99
patterns/design-patterns-2
@ -30,6 +30,17 @@
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${commons-lang3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.inferred</groupId>
|
||||
<artifactId>freebuilder</artifactId>
|
||||
<version>${freebuilder.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>${javax.annotations.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@ -38,5 +49,7 @@
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<intellij.annotations.version>16.0.2</intellij.annotations.version>
|
||||
<freebuilder.version>2.4.1</freebuilder.version>
|
||||
<javax.annotations.version>3.0.2</javax.annotations.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.freebuilder.builder.classic;
|
||||
package com.baeldung.freebuilder;
|
||||
|
||||
import org.inferred.freebuilder.FreeBuilder;
|
||||
|
@ -1,13 +1,11 @@
|
||||
package com.baeldung.freebuilder;
|
||||
|
||||
import com.baeldung.freebuilder.builder.classic.Address;
|
||||
import org.inferred.freebuilder.FreeBuilder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
@FreeBuilder
|
||||
public interface Employee {
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.freebuilder.builder.classic;
|
||||
package com.baeldung.freebuilder.builder;
|
||||
|
||||
public class Employee {
|
||||
|
@ -1,16 +1,14 @@
|
||||
package com.baeldung.freebuilder;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import com.baeldung.freebuilder.builder.classic.Address;
|
||||
|
||||
public class EmployeeBuilderUnitTest {
|
||||
|
||||
private static final int PIN_CODE = 223344;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.freebuilder.builder.classic;
|
||||
package com.baeldung.freebuilder.builder;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
Loading…
x
Reference in New Issue
Block a user