-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle booleans more gracefully
- Loading branch information
1 parent
286a122
commit 3a8fdc3
Showing
8 changed files
with
101 additions
and
7 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ | |
</dependency> | ||
</dependencies> | ||
|
||
</project> | ||
</project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,10 @@ | |
<name>Jonas Geiregat</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
<developer> | ||
<name>Joran Van Belle</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
</developers> | ||
|
||
<licenses> | ||
|
@@ -293,4 +297,4 @@ | |
</repository> | ||
</distributionManagement> | ||
|
||
</project> | ||
</project> |
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
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
21 changes: 21 additions & 0 deletions
21
...esources/tests/BooleanFieldHasOtherNameThanSetter/BooleanFieldHasOtherNameThanSetter.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.jonasg.bob.test; | ||
|
||
import io.jonasg.bob.Buildable; | ||
|
||
@Buildable | ||
public class BooleanFieldHasOtherNameThanSetter { | ||
private String firstName; | ||
|
||
private String lastName; | ||
|
||
private boolean isHappy; | ||
|
||
public BooleanFieldHasOtherNameThanSetter(String firstName, String lastName) { | ||
this.firstName = firstName; | ||
this.lastName = lastName; | ||
} | ||
|
||
public void setHappy(boolean ishappy) { | ||
this.isHappy = ishappy; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...tests/BooleanFieldHasOtherNameThanSetter/Expected_BooleanFieldHasOtherNameThanSetter.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.jonasg.bob.test; | ||
|
||
import java.lang.String; | ||
|
||
public final class BooleanFieldHasOtherNameThanSetterBuilder { | ||
private String firstName; | ||
|
||
private String lastName; | ||
|
||
private boolean isHappy; | ||
|
||
public BooleanFieldHasOtherNameThanSetterBuilder() { | ||
} | ||
|
||
public BooleanFieldHasOtherNameThanSetterBuilder firstName(String firstName) { | ||
this.firstName = firstName; | ||
return this; | ||
} | ||
|
||
public BooleanFieldHasOtherNameThanSetterBuilder lastName(String lastName) { | ||
this.lastName = lastName; | ||
return this; | ||
} | ||
|
||
public BooleanFieldHasOtherNameThanSetterBuilder isHappy(boolean isHappy) { | ||
this.isHappy = isHappy; | ||
return this; | ||
} | ||
|
||
public BooleanFieldHasOtherNameThanSetter build() { | ||
var instance = new BooleanFieldHasOtherNameThanSetter(firstName, lastName); | ||
instance.setHappy(this.isHappy); | ||
return instance; | ||
} | ||
} |
Empty file.