-
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.
Add abstract class Tag, extend Tag with SingleTag and PairedTag
Complete inheritance task.
- Loading branch information
Showing
3 changed files
with
48 additions
and
2 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
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,8 +1,25 @@ | ||
package exercise; | ||
|
||
import java.util.stream.Collectors; | ||
import java.util.Map; | ||
|
||
// BEGIN | ||
public abstract class Tag { | ||
private final String tag; | ||
private final Map<String, String> attributes; | ||
|
||
public Tag(String tag, Map<String, String> attributes) { | ||
this.tag = tag; | ||
this.attributes = attributes; | ||
} | ||
|
||
public abstract String toString(); | ||
|
||
public String getTag() { | ||
return tag; | ||
} | ||
|
||
public Map<String, String> getAttributes() { | ||
return attributes; | ||
} | ||
} | ||
// END |