-
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.
- Loading branch information
1 parent
b087535
commit 1b66278
Showing
4 changed files
with
80 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
33 changes: 33 additions & 0 deletions
33
...rces/tests/successful-compilation/GenericsAreBuildable/Expected_GenericsAreBuildable.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,33 @@ | ||
package io.jonasg.bob.test.builder; | ||
|
||
import io.jonasg.bob.test.GenericsAreBuildable; | ||
import java.lang.Class; | ||
import java.lang.String; | ||
|
||
public final class GenericsAreBuildableBuilder<T, R extends String> { | ||
private T contents; | ||
|
||
private R topping; | ||
|
||
public GenericsAreBuildableBuilder() { | ||
} | ||
|
||
public GenericsAreBuildableBuilder<T, R> contents(T contents) { | ||
this.contents = contents; | ||
return this; | ||
} | ||
|
||
public GenericsAreBuildableBuilder<T, R> topping(R topping) { | ||
this.topping = topping; | ||
return this; | ||
} | ||
|
||
public GenericsAreBuildable<T, R> build() { | ||
return new GenericsAreBuildable<T, R>(contents, topping); | ||
} | ||
|
||
public static <T, R extends String> GenericsAreBuildableBuilder<T, R> of(Class<T> Ttype, | ||
Class<R> Rtype) { | ||
return new GenericsAreBuildableBuilder<>(); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...est/resources/tests/successful-compilation/GenericsAreBuildable/GenericsAreBuildable.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,16 @@ | ||
package io.jonasg.bob.test; | ||
|
||
import java.lang.String; | ||
import io.jonasg.bob.Buildable; | ||
|
||
@Buildable | ||
public class GenericsAreBuildable<T, R extends String> { | ||
|
||
private T contents; | ||
private R topping; | ||
|
||
public GenericsAreBuildable(T contents, R topping) { | ||
this.contents = contents; | ||
this.topping = topping; | ||
} | ||
} |