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
bfb5ecf
commit 8df0bc2
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
11 changes: 9 additions & 2 deletions
11
tdd-diamond/src/main/java/com/michaelszymczak/diamond/Diamond.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,18 @@ | |||
package com.michaelszymczak.diamond; | package com.michaelszymczak.diamond; | ||
|
|
||
public class Diamond { | public class Diamond { | ||
|
|||
private char letter; | |||
|
|||
public static Diamond of(char letter) { | public static Diamond of(char letter) { | ||
return new Diamond(); | return new Diamond(letter); | ||
} | |||
|
|||
private Diamond(char letter) { | |||
this.letter = letter; | |||
} | } | ||
|
|
||
public String rendered() { | public String rendered() { | ||
return "A"; | return letter == 'A' ? "A" : " A \nB B\n A "; | ||
} | } | ||
} | } |
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