info.tomfi.hebcal.shabbat.response.AutoValue_ResponseItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hebcal-api Show documentation
Show all versions of hebcal-api Show documentation
A Java API encapsulating HebCal's REST API.
package info.tomfi.hebcal.shabbat.response;
import info.tomfi.hebcal.shabbat.internal.Nullable;
import java.util.Optional;
// Generated by com.google.auto.value.processor.AutoValueProcessor
final class AutoValue_ResponseItem extends ResponseItem {
private final Optional hebrew;
private final String date;
private final String title;
private final String category;
private final Optional titleOrig;
private final Optional link;
private final Optional memo;
private final Optional subcat;
private final Optional yomtov;
private AutoValue_ResponseItem(
Optional hebrew,
String date,
String title,
String category,
Optional titleOrig,
Optional link,
Optional memo,
Optional subcat,
Optional yomtov) {
this.hebrew = hebrew;
this.date = date;
this.title = title;
this.category = category;
this.titleOrig = titleOrig;
this.link = link;
this.memo = memo;
this.subcat = subcat;
this.yomtov = yomtov;
}
@Override
public Optional hebrew() {
return hebrew;
}
@Override
public String date() {
return date;
}
@Override
public String title() {
return title;
}
@Override
public String category() {
return category;
}
@Override
public Optional titleOrig() {
return titleOrig;
}
@Override
public Optional link() {
return link;
}
@Override
public Optional memo() {
return memo;
}
@Override
public Optional subcat() {
return subcat;
}
@Override
public Optional yomtov() {
return yomtov;
}
@Override
public String toString() {
return "ResponseItem{"
+ "hebrew=" + hebrew + ", "
+ "date=" + date + ", "
+ "title=" + title + ", "
+ "category=" + category + ", "
+ "titleOrig=" + titleOrig + ", "
+ "link=" + link + ", "
+ "memo=" + memo + ", "
+ "subcat=" + subcat + ", "
+ "yomtov=" + yomtov
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ResponseItem) {
ResponseItem that = (ResponseItem) o;
return this.hebrew.equals(that.hebrew())
&& this.date.equals(that.date())
&& this.title.equals(that.title())
&& this.category.equals(that.category())
&& this.titleOrig.equals(that.titleOrig())
&& this.link.equals(that.link())
&& this.memo.equals(that.memo())
&& this.subcat.equals(that.subcat())
&& this.yomtov.equals(that.yomtov());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= hebrew.hashCode();
h$ *= 1000003;
h$ ^= date.hashCode();
h$ *= 1000003;
h$ ^= title.hashCode();
h$ *= 1000003;
h$ ^= category.hashCode();
h$ *= 1000003;
h$ ^= titleOrig.hashCode();
h$ *= 1000003;
h$ ^= link.hashCode();
h$ *= 1000003;
h$ ^= memo.hashCode();
h$ *= 1000003;
h$ ^= subcat.hashCode();
h$ *= 1000003;
h$ ^= yomtov.hashCode();
return h$;
}
static final class Builder extends ResponseItem.Builder {
private Optional hebrew = Optional.empty();
private String date;
private String title;
private String category;
private Optional titleOrig = Optional.empty();
private Optional link = Optional.empty();
private Optional memo = Optional.empty();
private Optional subcat = Optional.empty();
private Optional yomtov = Optional.empty();
Builder() {
}
@Override
public ResponseItem.Builder hebrew(@Nullable String hebrew) {
this.hebrew = Optional.ofNullable(hebrew);
return this;
}
@Override
public ResponseItem.Builder date(String date) {
if (date == null) {
throw new NullPointerException("Null date");
}
this.date = date;
return this;
}
@Override
public ResponseItem.Builder title(String title) {
if (title == null) {
throw new NullPointerException("Null title");
}
this.title = title;
return this;
}
@Override
public ResponseItem.Builder category(String category) {
if (category == null) {
throw new NullPointerException("Null category");
}
this.category = category;
return this;
}
@Override
public ResponseItem.Builder titleOrig(@Nullable String titleOrig) {
this.titleOrig = Optional.ofNullable(titleOrig);
return this;
}
@Override
public ResponseItem.Builder link(@Nullable String link) {
this.link = Optional.ofNullable(link);
return this;
}
@Override
public ResponseItem.Builder memo(@Nullable String memo) {
this.memo = Optional.ofNullable(memo);
return this;
}
@Override
public ResponseItem.Builder subcat(@Nullable String subcat) {
this.subcat = Optional.ofNullable(subcat);
return this;
}
@Override
public ResponseItem.Builder yomtov(@Nullable Boolean yomtov) {
this.yomtov = Optional.ofNullable(yomtov);
return this;
}
@Override
public ResponseItem build() {
if (this.date == null
|| this.title == null
|| this.category == null) {
StringBuilder missing = new StringBuilder();
if (this.date == null) {
missing.append(" date");
}
if (this.title == null) {
missing.append(" title");
}
if (this.category == null) {
missing.append(" category");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_ResponseItem(
this.hebrew,
this.date,
this.title,
this.category,
this.titleOrig,
this.link,
this.memo,
this.subcat,
this.yomtov);
}
}
}