Skip to content

Commit

Permalink
Added JsonIgnore annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
essiembre committed Dec 4, 2023
1 parent 9ef1038 commit 016e876
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.norconex.commons.lang.CircularRange;
import com.norconex.crawler.core.crawler.CrawlerException;
Expand Down Expand Up @@ -62,15 +63,19 @@ boolean isDateTimeInSchedule(LocalDateTime dt) {
return timeRange == null || timeRange.contains(
(dt.getHour() * 100) + dt.getMinute());
}
@JsonIgnore
public CircularRange<DelaySchedule.DOW> getDayOfWeekRange() {
return dayOfWeekRange;
}
@JsonIgnore
public CircularRange<Integer> getDayOfMonthRange() {
return dayOfMonthRange;
}
@JsonIgnore
public CircularRange<Integer> getTimeRange() {
return timeRange;
}

public long getDelay() {
return delay;
}
Expand Down Expand Up @@ -127,4 +132,24 @@ private String normalize(String str) {
}
return out;
}

//NOTE: The following methods are so Api schema generation
// references are generated to CircularReference as opposed
// to CircularReferenceInteger, CircularReferenceDOW, etc.
// If there is a better way delete these.
@SuppressWarnings("rawtypes")
@JsonProperty("dayOfWeekRange")
CircularRange dayOfWeekRange() {
return dayOfWeekRange;
}
@SuppressWarnings("rawtypes")
@JsonProperty("dayOfMonthRange")
CircularRange dayOfMonthRange() {
return dayOfMonthRange;
}
@SuppressWarnings("rawtypes")
@JsonProperty("timeRange")
CircularRange timeRange() {
return timeRange;
}
}

0 comments on commit 016e876

Please sign in to comment.