-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Time Series endpoint impl * Update to version 3.3.1
- Loading branch information
1 parent
311aa62
commit 0dee394
Showing
24 changed files
with
826 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
iextrading4j-api/src/main/java/pl/zankowski/iextrading4j/api/datapoint/FieldMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package pl.zankowski.iextrading4j.api.datapoint; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
import com.google.common.base.MoreObjects; | ||
import com.google.common.base.Objects; | ||
|
||
import java.io.Serializable; | ||
|
||
@JsonPropertyOrder({"type"}) | ||
public class FieldMetadata implements Serializable { | ||
|
||
private static final long serialVersionUID = -4105749852777766636L; | ||
|
||
private final String type; | ||
|
||
@JsonCreator | ||
public FieldMetadata( | ||
@JsonProperty("type") final String type) { | ||
this.type = type; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
final FieldMetadata that = (FieldMetadata) o; | ||
return Objects.equal(type, that.type); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(type); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return MoreObjects.toStringHelper(this) | ||
.add("type", type) | ||
.toString(); | ||
} | ||
|
||
} |
112 changes: 112 additions & 0 deletions
112
...ading4j-api/src/main/java/pl/zankowski/iextrading4j/api/datapoint/TimeSeriesMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
package pl.zankowski.iextrading4j.api.datapoint; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
import com.google.common.base.MoreObjects; | ||
import com.google.common.base.Objects; | ||
|
||
import java.io.Serializable; | ||
import java.math.BigDecimal; | ||
import java.time.LocalDateTime; | ||
|
||
@JsonPropertyOrder({"id", "description", "schema", "weightKey", | ||
"weight", "created", "lastUpdated"}) | ||
public class TimeSeriesMetadata implements Serializable { | ||
|
||
private static final long serialVersionUID = -6089147392234388332L; | ||
|
||
private final String id; | ||
private final String description; | ||
private final TimeSeriesSchema schema; | ||
private final String weightKey; | ||
private final BigDecimal weight; | ||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
private final LocalDateTime created; | ||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
private final LocalDateTime lastUpdated; | ||
|
||
@JsonCreator | ||
public TimeSeriesMetadata( | ||
@JsonProperty("id") final String id, | ||
@JsonProperty("description") final String description, | ||
@JsonProperty("schema") final TimeSeriesSchema schema, | ||
@JsonProperty("weightKey") final String weightKey, | ||
@JsonProperty("weight") final BigDecimal weight, | ||
@JsonProperty("created") final LocalDateTime created, | ||
@JsonProperty("lastUpdated") final LocalDateTime lastUpdated) { | ||
this.id = id; | ||
this.description = description; | ||
this.schema = schema; | ||
this.weightKey = weightKey; | ||
this.weight = weight; | ||
this.created = created; | ||
this.lastUpdated = lastUpdated; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public TimeSeriesSchema getSchema() { | ||
return schema; | ||
} | ||
|
||
public String getWeightKey() { | ||
return weightKey; | ||
} | ||
|
||
public BigDecimal getWeight() { | ||
return weight; | ||
} | ||
|
||
public LocalDateTime getCreated() { | ||
return created; | ||
} | ||
|
||
public LocalDateTime getLastUpdated() { | ||
return lastUpdated; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
final TimeSeriesMetadata that = (TimeSeriesMetadata) o; | ||
return Objects.equal(id, that.id) && | ||
Objects.equal(description, that.description) && | ||
Objects.equal(schema, that.schema) && | ||
Objects.equal(weightKey, that.weightKey) && | ||
Objects.equal(weight, that.weight) && | ||
Objects.equal(created, that.created) && | ||
Objects.equal(lastUpdated, that.lastUpdated); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(id, description, schema, weightKey, weight, created, lastUpdated); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return MoreObjects.toStringHelper(this) | ||
.add("id", id) | ||
.add("description", description) | ||
.add("schema", schema) | ||
.add("weightKey", weightKey) | ||
.add("weight", weight) | ||
.add("created", created) | ||
.add("lastUpdated", lastUpdated) | ||
.toString(); | ||
} | ||
|
||
} |
84 changes: 84 additions & 0 deletions
84
iextrading4j-api/src/main/java/pl/zankowski/iextrading4j/api/datapoint/TimeSeriesSchema.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package pl.zankowski.iextrading4j.api.datapoint; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
import com.google.common.base.MoreObjects; | ||
import com.google.common.base.Objects; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static pl.zankowski.iextrading4j.api.util.ListUtil.immutableList; | ||
import static pl.zankowski.iextrading4j.api.util.MapUtil.immutableMap; | ||
|
||
@JsonPropertyOrder({"type", "properties", "required", "additionalProperties"}) | ||
public class TimeSeriesSchema implements Serializable { | ||
|
||
private static final long serialVersionUID = 925614403539934677L; | ||
|
||
private final String type; | ||
private final Map<String, FieldMetadata> properties; | ||
private final List<String> required; | ||
private final boolean additionalProperties; | ||
|
||
@JsonCreator | ||
public TimeSeriesSchema( | ||
@JsonProperty("type") final String type, | ||
@JsonProperty("properties") final Map<String, FieldMetadata> properties, | ||
@JsonProperty("required") final List<String> required, | ||
@JsonProperty("additionalProperties") final boolean additionalProperties) { | ||
this.type = type; | ||
this.properties = immutableMap(properties); | ||
this.required = immutableList(required); | ||
this.additionalProperties = additionalProperties; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public Map<String, FieldMetadata> getProperties() { | ||
return properties; | ||
} | ||
|
||
public List<String> getRequired() { | ||
return required; | ||
} | ||
|
||
public boolean isAdditionalProperties() { | ||
return additionalProperties; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
final TimeSeriesSchema that = (TimeSeriesSchema) o; | ||
return additionalProperties == that.additionalProperties && | ||
Objects.equal(type, that.type) && | ||
Objects.equal(properties, that.properties) && | ||
Objects.equal(required, that.required); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(type, properties, required, additionalProperties); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return MoreObjects.toStringHelper(this) | ||
.add("type", type) | ||
.add("properties", properties) | ||
.add("required", required) | ||
.add("additionalProperties", additionalProperties) | ||
.toString(); | ||
} | ||
|
||
} |
Oops, something went wrong.