From 7900841d4a69f443ef18c307ecb81e7b15c41f8b Mon Sep 17 00:00:00 2001 From: Brian Long Date: Sun, 12 Feb 2023 12:32:56 -0500 Subject: [PATCH] extended photo model for golf --- .../poststats/golf/api/model/BasePhoto.java | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/main/java/com/poststats/golf/api/model/BasePhoto.java diff --git a/src/main/java/com/poststats/golf/api/model/BasePhoto.java b/src/main/java/com/poststats/golf/api/model/BasePhoto.java new file mode 100644 index 0000000..f2710c0 --- /dev/null +++ b/src/main/java/com/poststats/golf/api/model/BasePhoto.java @@ -0,0 +1,67 @@ +package com.poststats.golf.api.model; + +import java.util.LinkedList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * @author brian.long@poststats.com + */ +public abstract class BasePhoto> extends com.poststats.api.model.BasePhoto { + + @JsonProperty + private List courseIds; + + @JsonProperty + private List eventIds; + + @JsonProperty + private List seriesIds; + + public List getCourseIds() { + return courseIds; + } + + public void setCourseIds(List courseIds) { + this.courseIds = courseIds; + } + + public List getEventIds() { + return eventIds; + } + + public void setEventIds(List eventIds) { + this.eventIds = eventIds; + } + + public List getSeriesIds() { + return seriesIds; + } + + public void setSeriesIds(List seriesIds) { + this.seriesIds = seriesIds; + } + + public ConcreteT withCourseId(int courseId) { + if (this.courseIds == null) + this.courseIds = new LinkedList<>(); + this.courseIds.add(courseId); + return this.withThis(); + } + + public ConcreteT withEventId(long eventId) { + if (this.eventIds == null) + this.eventIds = new LinkedList<>(); + this.eventIds.add(eventId); + return this.withThis(); + } + + public ConcreteT withSeriesId(int seriesId) { + if (this.seriesIds == null) + this.seriesIds = new LinkedList<>(); + this.seriesIds.add(seriesId); + return this.withThis(); + } + +}