Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local variable type inference changes #1039

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
local variable type inference changes
local variable type inference changes for step builder design pattern
  • Loading branch information
gvsharma committed Oct 26, 2019
commit 13f27b92c675368ec8c81aa669a26d2b9b914505
6 changes: 3 additions & 3 deletions step-builder/src/main/java/com/iluwatar/stepbuilder/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@ public class App {
*/
public static void main(String[] args) {

Character warrior =
var warrior =
CharacterStepBuilder.newBuilder().name("Amberjill").fighterClass("Paladin")
.withWeapon("Sword").noAbilities().build();

LOGGER.info(warrior.toString());

Character mage =
var mage =
CharacterStepBuilder.newBuilder().name("Riobard").wizardClass("Sorcerer")
.withSpell("Fireball").withAbility("Fire Aura").withAbility("Teleport")
.noMoreAbilities().build();

LOGGER.info(mage.toString());

Character thief =
var thief =
CharacterStepBuilder.newBuilder().name("Desmond").fighterClass("Rogue").noWeapon().build();

LOGGER.info(thief.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void setAbilities(List<String> abilities) {

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
var sb = new StringBuilder();
sb.append("This is a ")
.append(fighterClass != null ? fighterClass : wizardClass)
.append(" named ")
Expand Down