com.factset.sdk.DirectStreamingofTransactionMessages.models.Transactions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of directstreamingoftransactionmessages Show documentation
Show all versions of directstreamingoftransactionmessages Show documentation
FactSet SDK for Java - directstreamingoftransactionmessages
/*
* DSOTM API
* Allow clients to send transactions data to FactSet.
*
* The version of the OpenAPI document: 1.3.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.factset.sdk.DirectStreamingofTransactionMessages.models;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.factset.sdk.DirectStreamingofTransactionMessages.models.ExecutionParameters;
import com.factset.sdk.DirectStreamingofTransactionMessages.models.OrderParameters;
import com.factset.sdk.DirectStreamingofTransactionMessages.models.PlacementParameters;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.factset.sdk.DirectStreamingofTransactionMessages.JSON;
/**
* Transactions
*/
@JsonPropertyOrder({
Transactions.JSON_PROPERTY_EXECUTIONS,
Transactions.JSON_PROPERTY_PLACEMENTS,
Transactions.JSON_PROPERTY_ORDERS
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Transactions implements Serializable {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_EXECUTIONS = "executions";
private JsonNullable> executions = JsonNullable.>undefined();
public static final String JSON_PROPERTY_PLACEMENTS = "placements";
private JsonNullable> placements = JsonNullable.>undefined();
public static final String JSON_PROPERTY_ORDERS = "orders";
private JsonNullable> orders = JsonNullable.>undefined();
public Transactions() {
}
public Transactions executions(java.util.List executions) {
this.executions = JsonNullable.>of(executions);
return this;
}
public Transactions addExecutionsItem(ExecutionParameters executionsItem) {
if (this.executions == null || !this.executions.isPresent()) {
this.executions = JsonNullable.>of(new java.util.ArrayList<>());
}
try {
this.executions.get().add(executionsItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}
/**
* List of executions
* @return executions
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of executions")
@JsonIgnore
public java.util.List getExecutions() {
return executions.orElse(null);
}
@JsonProperty(JSON_PROPERTY_EXECUTIONS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable> getExecutions_JsonNullable() {
return executions;
}
@JsonProperty(JSON_PROPERTY_EXECUTIONS)
public void setExecutions_JsonNullable(JsonNullable> executions) {
this.executions = executions;
}
public void setExecutions(java.util.List executions) {
this.executions = JsonNullable.>of(executions);
}
public Transactions placements(java.util.List placements) {
this.placements = JsonNullable.>of(placements);
return this;
}
public Transactions addPlacementsItem(PlacementParameters placementsItem) {
if (this.placements == null || !this.placements.isPresent()) {
this.placements = JsonNullable.>of(new java.util.ArrayList<>());
}
try {
this.placements.get().add(placementsItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}
/**
* List of placements
* @return placements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of placements")
@JsonIgnore
public java.util.List getPlacements() {
return placements.orElse(null);
}
@JsonProperty(JSON_PROPERTY_PLACEMENTS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable> getPlacements_JsonNullable() {
return placements;
}
@JsonProperty(JSON_PROPERTY_PLACEMENTS)
public void setPlacements_JsonNullable(JsonNullable> placements) {
this.placements = placements;
}
public void setPlacements(java.util.List placements) {
this.placements = JsonNullable.>of(placements);
}
public Transactions orders(java.util.List orders) {
this.orders = JsonNullable.>of(orders);
return this;
}
public Transactions addOrdersItem(OrderParameters ordersItem) {
if (this.orders == null || !this.orders.isPresent()) {
this.orders = JsonNullable.>of(new java.util.ArrayList<>());
}
try {
this.orders.get().add(ordersItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}
/**
* List of orders
* @return orders
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of orders")
@JsonIgnore
public java.util.List getOrders() {
return orders.orElse(null);
}
@JsonProperty(JSON_PROPERTY_ORDERS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable> getOrders_JsonNullable() {
return orders;
}
@JsonProperty(JSON_PROPERTY_ORDERS)
public void setOrders_JsonNullable(JsonNullable> orders) {
this.orders = orders;
}
public void setOrders(java.util.List orders) {
this.orders = JsonNullable.>of(orders);
}
/**
* Return true if this Transactions object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Transactions transactions = (Transactions) o;
return equalsNullable(this.executions, transactions.executions) &&
equalsNullable(this.placements, transactions.placements) &&
equalsNullable(this.orders, transactions.orders);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(hashCodeNullable(executions), hashCodeNullable(placements), hashCodeNullable(orders));
}
private static int hashCodeNullable(JsonNullable a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Transactions {\n");
sb.append(" executions: ").append(toIndentedString(executions)).append("\n");
sb.append(" placements: ").append(toIndentedString(placements)).append("\n");
sb.append(" orders: ").append(toIndentedString(orders)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}