From b5ad47d5b77bfc023b9d3d466f9fd9ed2c29a452 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 12 May 2015 07:26:22 -0700 Subject: Adding tests for TrainingRecordResource. --- src/com/p4square/grow/model/Chapter.java | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/com/p4square/grow/model/Chapter.java') diff --git a/src/com/p4square/grow/model/Chapter.java b/src/com/p4square/grow/model/Chapter.java index 7b6e27c..3a08e4c 100644 --- a/src/com/p4square/grow/model/Chapter.java +++ b/src/com/p4square/grow/model/Chapter.java @@ -17,12 +17,37 @@ import com.fasterxml.jackson.annotation.JsonIgnore; * @author Jesse Morgan */ public class Chapter implements Cloneable { + private String mName; private Map mVideos; - public Chapter() { + public Chapter(String name) { + mName = name; mVideos = new HashMap(); } + /** + * Private constructor for JSON decoding. + */ + private Chapter() { + this(null); + } + + /** + * @return The Chapter name. + */ + public String getName() { + return mName; + } + + /** + * Set the chapter name. + * + * @param name The name of the chapter. + */ + public void setName(final String name) { + mName = name; + } + /** * @return The VideoRecord for videoid or null if videoid is not in the chapter. */ @@ -78,7 +103,7 @@ public class Chapter implements Cloneable { * @return a new Chapter object identical but independent of this one. */ public Chapter clone() throws CloneNotSupportedException { - Chapter c = new Chapter(); + Chapter c = new Chapter(mName); for (Map.Entry videoEntry : mVideos.entrySet()) { c.setVideoRecord(videoEntry.getKey(), videoEntry.getValue().clone()); } -- cgit v1.2.3