extended photo model for golf
This commit is contained in:
67
src/main/java/com/poststats/golf/api/model/BasePhoto.java
Normal file
67
src/main/java/com/poststats/golf/api/model/BasePhoto.java
Normal file
@@ -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<ConcreteT extends BasePhoto<ConcreteT>> extends com.poststats.api.model.BasePhoto<ConcreteT> {
|
||||
|
||||
@JsonProperty
|
||||
private List<Integer> courseIds;
|
||||
|
||||
@JsonProperty
|
||||
private List<Long> eventIds;
|
||||
|
||||
@JsonProperty
|
||||
private List<Integer> seriesIds;
|
||||
|
||||
public List<Integer> getCourseIds() {
|
||||
return courseIds;
|
||||
}
|
||||
|
||||
public void setCourseIds(List<Integer> courseIds) {
|
||||
this.courseIds = courseIds;
|
||||
}
|
||||
|
||||
public List<Long> getEventIds() {
|
||||
return eventIds;
|
||||
}
|
||||
|
||||
public void setEventIds(List<Long> eventIds) {
|
||||
this.eventIds = eventIds;
|
||||
}
|
||||
|
||||
public List<Integer> getSeriesIds() {
|
||||
return seriesIds;
|
||||
}
|
||||
|
||||
public void setSeriesIds(List<Integer> 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();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user