thomsonreuters.dss.api.search.complex.HistoricalSearchResult Maven / Gradle / Ivy
package thomsonreuters.dss.api.search.complex;
import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.github.davidmoten.odata.client.CollectionPage;
import com.github.davidmoten.odata.client.ODataType;
import com.github.davidmoten.odata.client.Util;
import com.github.davidmoten.odata.client.annotation.Property;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.UnmappedFields;
import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import thomsonreuters.dss.api.content.complex.ValidatedInstrument;
import thomsonreuters.dss.api.content.enums.IdentifierType;
import thomsonreuters.dss.api.content.enums.InstrumentType;
import thomsonreuters.dss.api.content.enums.ValidityStatus;
import thomsonreuters.dss.api.search.complex.HistoricalInstrumentRicChangeHistory;
import thomsonreuters.dss.api.search.schema.SchemaInfo;
@JsonInclude(Include.NON_NULL)
@JsonPropertyOrder({
"@odata.type",
"DomainCode",
"ValidFrom",
"ValidTo",
"FirstDate",
"LastDate",
"History"})
public class HistoricalSearchResult extends ValidatedInstrument implements ODataType {
@JacksonInject
@JsonIgnore
protected UnmappedFields unmappedFields;
@JsonProperty("DomainCode")
protected String domainCode;
@JsonProperty("ValidFrom")
protected OffsetDateTime validFrom;
@JsonProperty("ValidTo")
protected OffsetDateTime validTo;
@JsonProperty("FirstDate")
protected OffsetDateTime firstDate;
@JsonProperty("LastDate")
protected OffsetDateTime lastDate;
@JsonProperty("History")
protected List history;
@JsonProperty("History@nextLink")
protected String historyNextLink;
protected HistoricalSearchResult() {
super();
}
@Override
public String odataTypeName() {
return "ThomsonReuters.Dss.Api.Search.HistoricalSearchResult";
}
@Property(name="DomainCode")
@JsonIgnore
public Optional getDomainCode() {
return Optional.ofNullable(domainCode);
}
public HistoricalSearchResult withDomainCode(String domainCode) {
HistoricalSearchResult _x = _copy();
_x.odataType = Util.nvl(odataType, "ThomsonReuters.Dss.Api.Search.HistoricalSearchResult");
_x.domainCode = domainCode;
return _x;
}
@Property(name="ValidFrom")
@JsonIgnore
public Optional getValidFrom() {
return Optional.ofNullable(validFrom);
}
public HistoricalSearchResult withValidFrom(OffsetDateTime validFrom) {
HistoricalSearchResult _x = _copy();
_x.odataType = Util.nvl(odataType, "ThomsonReuters.Dss.Api.Search.HistoricalSearchResult");
_x.validFrom = validFrom;
return _x;
}
@Property(name="ValidTo")
@JsonIgnore
public Optional getValidTo() {
return Optional.ofNullable(validTo);
}
public HistoricalSearchResult withValidTo(OffsetDateTime validTo) {
HistoricalSearchResult _x = _copy();
_x.odataType = Util.nvl(odataType, "ThomsonReuters.Dss.Api.Search.HistoricalSearchResult");
_x.validTo = validTo;
return _x;
}
@Property(name="FirstDate")
@JsonIgnore
public Optional getFirstDate() {
return Optional.ofNullable(firstDate);
}
public HistoricalSearchResult withFirstDate(OffsetDateTime firstDate) {
HistoricalSearchResult _x = _copy();
_x.odataType = Util.nvl(odataType, "ThomsonReuters.Dss.Api.Search.HistoricalSearchResult");
_x.firstDate = firstDate;
return _x;
}
@Property(name="LastDate")
@JsonIgnore
public Optional getLastDate() {
return Optional.ofNullable(lastDate);
}
public HistoricalSearchResult withLastDate(OffsetDateTime lastDate) {
HistoricalSearchResult _x = _copy();
_x.odataType = Util.nvl(odataType, "ThomsonReuters.Dss.Api.Search.HistoricalSearchResult");
_x.lastDate = lastDate;
return _x;
}
@Property(name="History")
@JsonIgnore
public CollectionPage getHistory() {
return new CollectionPage(contextPath, HistoricalInstrumentRicChangeHistory.class, history, Optional.ofNullable(historyNextLink), SchemaInfo.INSTANCE, Collections.emptyList());
}
@JsonAnySetter
private void setUnmappedField(String name, Object value) {
if (unmappedFields == null) {
unmappedFields = new UnmappedFields();
}
unmappedFields.put(name, value);
}
@Override
@JsonIgnore
public UnmappedFields getUnmappedFields() {
return unmappedFields == null ? new UnmappedFields() : unmappedFields;
}
@Override
public void postInject(boolean addKeysToContextPath) {
// do nothing;
}
/**
* Returns a builder which is used to create a new
* instance of this class (given that this class is immutable).
*
* @return a new Builder for this class
*/
// Suffix used on builder factory method to differentiate the method
// from static builder methods on superclasses
public static Builder builderHistoricalSearchResult() {
return new Builder();
}
public static final class Builder {
private String key;
private String description;
private InstrumentType instrumentType;
private ValidityStatus status;
private String source;
private String identifier;
private IdentifierType identifierType;
private String userDefinedIdentifier;
private String userDefinedIdentifier2;
private String userDefinedIdentifier3;
private String userDefinedIdentifier4;
private String userDefinedIdentifier5;
private String userDefinedIdentifier6;
private String domainCode;
private OffsetDateTime validFrom;
private OffsetDateTime validTo;
private OffsetDateTime firstDate;
private OffsetDateTime lastDate;
private List history;
private String historyNextLink;
private ChangedFields changedFields = new ChangedFields();
Builder() {
// prevent instantiation
}
public Builder key(String key) {
this.key = key;
this.changedFields = changedFields.add("Key");
return this;
}
public Builder description(String description) {
this.description = description;
this.changedFields = changedFields.add("Description");
return this;
}
public Builder instrumentType(InstrumentType instrumentType) {
this.instrumentType = instrumentType;
this.changedFields = changedFields.add("InstrumentType");
return this;
}
public Builder status(ValidityStatus status) {
this.status = status;
this.changedFields = changedFields.add("Status");
return this;
}
public Builder source(String source) {
this.source = source;
this.changedFields = changedFields.add("Source");
return this;
}
public Builder identifier(String identifier) {
this.identifier = identifier;
this.changedFields = changedFields.add("Identifier");
return this;
}
public Builder identifierType(IdentifierType identifierType) {
this.identifierType = identifierType;
this.changedFields = changedFields.add("IdentifierType");
return this;
}
public Builder userDefinedIdentifier(String userDefinedIdentifier) {
this.userDefinedIdentifier = userDefinedIdentifier;
this.changedFields = changedFields.add("UserDefinedIdentifier");
return this;
}
public Builder userDefinedIdentifier2(String userDefinedIdentifier2) {
this.userDefinedIdentifier2 = userDefinedIdentifier2;
this.changedFields = changedFields.add("UserDefinedIdentifier2");
return this;
}
public Builder userDefinedIdentifier3(String userDefinedIdentifier3) {
this.userDefinedIdentifier3 = userDefinedIdentifier3;
this.changedFields = changedFields.add("UserDefinedIdentifier3");
return this;
}
public Builder userDefinedIdentifier4(String userDefinedIdentifier4) {
this.userDefinedIdentifier4 = userDefinedIdentifier4;
this.changedFields = changedFields.add("UserDefinedIdentifier4");
return this;
}
public Builder userDefinedIdentifier5(String userDefinedIdentifier5) {
this.userDefinedIdentifier5 = userDefinedIdentifier5;
this.changedFields = changedFields.add("UserDefinedIdentifier5");
return this;
}
public Builder userDefinedIdentifier6(String userDefinedIdentifier6) {
this.userDefinedIdentifier6 = userDefinedIdentifier6;
this.changedFields = changedFields.add("UserDefinedIdentifier6");
return this;
}
public Builder domainCode(String domainCode) {
this.domainCode = domainCode;
this.changedFields = changedFields.add("DomainCode");
return this;
}
public Builder validFrom(OffsetDateTime validFrom) {
this.validFrom = validFrom;
this.changedFields = changedFields.add("ValidFrom");
return this;
}
public Builder validTo(OffsetDateTime validTo) {
this.validTo = validTo;
this.changedFields = changedFields.add("ValidTo");
return this;
}
public Builder firstDate(OffsetDateTime firstDate) {
this.firstDate = firstDate;
this.changedFields = changedFields.add("FirstDate");
return this;
}
public Builder lastDate(OffsetDateTime lastDate) {
this.lastDate = lastDate;
this.changedFields = changedFields.add("LastDate");
return this;
}
public Builder history(List history) {
this.history = history;
this.changedFields = changedFields.add("History");
return this;
}
public Builder historyNextLink(String historyNextLink) {
this.historyNextLink = historyNextLink;
this.changedFields = changedFields.add("History");
return this;
}
public HistoricalSearchResult build() {
HistoricalSearchResult _x = new HistoricalSearchResult();
_x.contextPath = null;
_x.unmappedFields = new UnmappedFields();
_x.odataType = "ThomsonReuters.Dss.Api.Search.HistoricalSearchResult";
_x.key = key;
_x.description = description;
_x.instrumentType = instrumentType;
_x.status = status;
_x.source = source;
_x.identifier = identifier;
_x.identifierType = identifierType;
_x.userDefinedIdentifier = userDefinedIdentifier;
_x.userDefinedIdentifier2 = userDefinedIdentifier2;
_x.userDefinedIdentifier3 = userDefinedIdentifier3;
_x.userDefinedIdentifier4 = userDefinedIdentifier4;
_x.userDefinedIdentifier5 = userDefinedIdentifier5;
_x.userDefinedIdentifier6 = userDefinedIdentifier6;
_x.domainCode = domainCode;
_x.validFrom = validFrom;
_x.validTo = validTo;
_x.firstDate = firstDate;
_x.lastDate = lastDate;
_x.history = history;
_x.historyNextLink = historyNextLink;
return _x;
}
}
private HistoricalSearchResult _copy() {
HistoricalSearchResult _x = new HistoricalSearchResult();
_x.contextPath = contextPath;
_x.unmappedFields = unmappedFields;
_x.odataType = odataType;
_x.key = key;
_x.description = description;
_x.instrumentType = instrumentType;
_x.status = status;
_x.source = source;
_x.identifier = identifier;
_x.identifierType = identifierType;
_x.userDefinedIdentifier = userDefinedIdentifier;
_x.userDefinedIdentifier2 = userDefinedIdentifier2;
_x.userDefinedIdentifier3 = userDefinedIdentifier3;
_x.userDefinedIdentifier4 = userDefinedIdentifier4;
_x.userDefinedIdentifier5 = userDefinedIdentifier5;
_x.userDefinedIdentifier6 = userDefinedIdentifier6;
_x.domainCode = domainCode;
_x.validFrom = validFrom;
_x.validTo = validTo;
_x.firstDate = firstDate;
_x.lastDate = lastDate;
_x.history = history;
return _x;
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("HistoricalSearchResult[");
b.append("Key=");
b.append(this.key);
b.append(", ");
b.append("Description=");
b.append(this.description);
b.append(", ");
b.append("InstrumentType=");
b.append(this.instrumentType);
b.append(", ");
b.append("Status=");
b.append(this.status);
b.append(", ");
b.append("Source=");
b.append(this.source);
b.append(", ");
b.append("Identifier=");
b.append(this.identifier);
b.append(", ");
b.append("IdentifierType=");
b.append(this.identifierType);
b.append(", ");
b.append("UserDefinedIdentifier=");
b.append(this.userDefinedIdentifier);
b.append(", ");
b.append("UserDefinedIdentifier2=");
b.append(this.userDefinedIdentifier2);
b.append(", ");
b.append("UserDefinedIdentifier3=");
b.append(this.userDefinedIdentifier3);
b.append(", ");
b.append("UserDefinedIdentifier4=");
b.append(this.userDefinedIdentifier4);
b.append(", ");
b.append("UserDefinedIdentifier5=");
b.append(this.userDefinedIdentifier5);
b.append(", ");
b.append("UserDefinedIdentifier6=");
b.append(this.userDefinedIdentifier6);
b.append(", ");
b.append("DomainCode=");
b.append(this.domainCode);
b.append(", ");
b.append("ValidFrom=");
b.append(this.validFrom);
b.append(", ");
b.append("ValidTo=");
b.append(this.validTo);
b.append(", ");
b.append("FirstDate=");
b.append(this.firstDate);
b.append(", ");
b.append("LastDate=");
b.append(this.lastDate);
b.append(", ");
b.append("History=");
b.append(this.history);
b.append("]");
b.append(",unmappedFields=");
b.append(unmappedFields);
b.append(",odataType=");
b.append(odataType);
return b.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy