Skip to content

Commit

Permalink
submit java-oop-ru/patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
hexlet-cli committed Feb 5, 2024
1 parent e14b817 commit e1c29b5
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .current.json
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 java-oop-ru/patterns/src/main/java/exercise/InputTag.java
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 java-oop-ru/patterns/src/main/java/exercise/LabelTag.java
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 java-oop-ru/patterns/src/main/java/exercise/TagInterface.java
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

0 comments on commit e1c29b5

Please sign in to comment.