-
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 Files - ConcretePrototype (PrototypeFIles)
- Loading branch information
1 parent
b752a56
commit e910106
Showing
1 changed file
with
37 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// ConcretePrototype | ||
|
||
public abstract class Files implements File { | ||
private final String filename; | ||
private final String data; | ||
private final String metadata; | ||
|
||
public String getFilename() { | ||
return filename; | ||
} | ||
|
||
public String getData() { | ||
return data; | ||
} | ||
|
||
public String getMetadata() { | ||
return metadata; | ||
} | ||
|
||
public Files (String filename, String data, String metadata ){ | ||
this.filename = filename; | ||
this.data = data; | ||
this.metadata = metadata; | ||
} | ||
|
||
protected Files (Files file){ | ||
this.filename = file.filename; | ||
this.data = file.data; | ||
this.metadata = file.metadata; | ||
} | ||
|
||
public String toString() { | ||
return "File[filename=" + filename + ", data=" + data + ", metadata=" + metadata + "]"; | ||
} | ||
|
||
public abstract Files clone(); | ||
} |