-
Notifications
You must be signed in to change notification settings - Fork 0
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
e14b817
commit e1c29b5
Showing
4 changed files
with
42 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"assignment":"java-oop-ru/subtyping"} | ||
{"assignment":"java-oop-ru/patterns"} |
34 changes: 17 additions & 17 deletions
34
java-oop-ru/patterns/src/main/java/exercise/InputTag.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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package exercise; | ||
|
||
// BEGIN | ||
public class InputTag implements TagInterface{ | ||
private final String type; | ||
private final String value; | ||
|
||
public InputTag(String type, String value) { | ||
this.type = type; | ||
this.value = value; | ||
} | ||
|
||
public String render() { | ||
return String.format("<input type=\"%s\" value=\"%s\">", this.type, this.value); | ||
} | ||
} | ||
// END | ||
package exercise; | ||
|
||
// BEGIN | ||
public class InputTag implements TagInterface{ | ||
private final String type; | ||
private final String value; | ||
|
||
public InputTag(String type, String value) { | ||
this.type = type; | ||
this.value = value; | ||
} | ||
|
||
public String render() { | ||
return String.format("<input type=\"%s\" value=\"%s\">", this.type, this.value); | ||
} | ||
} | ||
// END |
34 changes: 17 additions & 17 deletions
34
java-oop-ru/patterns/src/main/java/exercise/LabelTag.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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package exercise; | ||
|
||
// BEGIN | ||
public class LabelTag implements TagInterface{ | ||
private final String label; | ||
private final TagInterface taggedText; | ||
|
||
public LabelTag(String label, TagInterface taggedText) { | ||
this.label = label; | ||
this.taggedText = taggedText; | ||
} | ||
|
||
public String render() { | ||
return String.format("<label>%s%s</label>", label, taggedText.render()); | ||
} | ||
} | ||
// END | ||
package exercise; | ||
|
||
// BEGIN | ||
public class LabelTag implements TagInterface{ | ||
private final String label; | ||
private final TagInterface taggedText; | ||
|
||
public LabelTag(String label, TagInterface taggedText) { | ||
this.label = label; | ||
this.taggedText = taggedText; | ||
} | ||
|
||
public String render() { | ||
return String.format("<label>%s%s</label>", label, taggedText.render()); | ||
} | ||
} | ||
// END |
14 changes: 7 additions & 7 deletions
14
java-oop-ru/patterns/src/main/java/exercise/TagInterface.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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package exercise; | ||
|
||
// BEGIN | ||
public interface TagInterface { | ||
String render(); | ||
} | ||
// END | ||
package exercise; | ||
|
||
// BEGIN | ||
public interface TagInterface { | ||
String render(); | ||
} | ||
// END |