Host.java 420 B

123456789101112131415161718192021222324
  1. package host;
  2. public abstract class Host {
  3. private String port;
  4. public Host(String port) {
  5. this.port = port;
  6. }
  7. public String getPort() {
  8. return this.port;
  9. }
  10. public void setPort(String port) {
  11. this.port = port;
  12. }
  13. public String toString() {
  14. return String.format("host %s port=%s", getContent(), getPort());
  15. }
  16. public abstract String getContent();
  17. public abstract void setContent(String content);
  18. }