Skip to content

Commit

Permalink
Update search prod model (#118)
Browse files Browse the repository at this point in the history
* Adjust symbol description model

* Update dependencies

* Release 3.4.4
  • Loading branch information
WojciechZankowski authored May 15, 2021
1 parent 835bb26 commit f1ab9a1
Show file tree
Hide file tree
Showing 12 changed files with 145 additions and 66 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.

## [3.4.4] - 2021-05-15

### Changed

- Updated ```SymbolDescription``` model with additional fields

## [3.4.3] - 2021-04-03

### Added
Expand Down Expand Up @@ -406,3 +412,4 @@ All notable changes to this project will be documented in this file.
[3.4.0]: https://github.com/WojciechZankowski/iextrading4j/compare/IT4J_RELEASE_3_3_4...IT4J_RELEASE_3_4_0
[3.4.2]: https://github.com/WojciechZankowski/iextrading4j/compare/IT4J_RELEASE_3_4_0...IT4J_RELEASE_3_4_2
[3.4.3]: https://github.com/WojciechZankowski/iextrading4j/compare/IT4J_RELEASE_3_4_2...IT4J_RELEASE_3_4_3
[3.4.4]: https://github.com/WojciechZankowski/iextrading4j/compare/IT4J_RELEASE_3_4_3...IT4J_RELEASE_3_4_4
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ Maven:
<dependency>
<groupId>pl.zankowski</groupId>
<artifactId>iextrading4j-all</artifactId>
<version>3.4.3</version>
<version>3.4.4</version>
</dependency>
```

Gradle:

```
dependencies {
compile 'pl.zankowski:iextrading4j-all:3.4.3'
compile 'pl.zankowski:iextrading4j-all:3.4.4'
}
```

Expand Down
2 changes: 1 addition & 1 deletion iextrading4j-acceptance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.4.3</version>
<version>3.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion iextrading4j-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.4.3</version>
<version>3.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion iextrading4j-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.4.3</version>
<version>3.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,63 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import pl.zankowski.iextrading4j.api.refdata.SymbolType;

import java.io.Serializable;
import java.util.Objects;
import java.util.StringJoiner;

public class SymbolDescription implements Serializable {

private static final long serialVersionUID = -7928382775445887294L;

private final String symbol;
private final String exchange;
private final String exchangeSuffix;
private final String exchangeName;
private final String name;
private final String type;
private final String iexId;
private final String region;
private final String currency;
private final String figi;
private final String cik;
private final String lei;
private final String securityName;
private final SymbolType securityType;
private final String region;
private final String exchange;
private final String sector;
private final String currency;


@JsonCreator
public SymbolDescription(
@JsonProperty("symbol") final String symbol,
@JsonProperty("exchange") final String exchange,
@JsonProperty("exchangeSuffix") final String exchangeSuffix,
@JsonProperty("exchangeName") final String exchangeName,
@JsonProperty("name") final String name,
@JsonProperty("type") final String type,
@JsonProperty("iexId") final String iexId,
@JsonProperty("region") final String region,
@JsonProperty("currency") final String currency,
@JsonProperty("figi") final String figi,
@JsonProperty("cik") final String cik,
@JsonProperty("lei") final String lei,
@JsonProperty("securityName") final String securityName,
@JsonProperty("securityType") final SymbolType securityType,
@JsonProperty("region") final String region,
@JsonProperty("exchange") final String exchange,
@JsonProperty("sector") final String sector,
@JsonProperty("currency") final String currency) {
@JsonProperty("sector") final String sector) {
this.symbol = symbol;
this.exchange = exchange;
this.exchangeSuffix = exchangeSuffix;
this.exchangeName = exchangeName;
this.name = name;
this.type = type;
this.iexId = iexId;
this.figi = figi;
this.cik = cik;
this.lei = lei;
this.securityName = securityName;
this.securityType = securityType;
this.region = region;
this.exchange = exchange;
this.sector = sector;
this.currency = currency;
}
Expand All @@ -45,34 +67,62 @@ public String getSymbol() {
return symbol;
}

public String getCik() {
return cik;
public String getExchange() {
return exchange;
}

public String getSecurityName() {
return securityName;
public String getExchangeSuffix() {
return exchangeSuffix;
}

public SymbolType getSecurityType() {
return securityType;
public String getExchangeName() {
return exchangeName;
}

public String getRegion() {
return region;
public String getName() {
return name;
}

public String getExchange() {
return exchange;
public String getType() {
return type;
}

public String getSector() {
return sector;
public String getIexId() {
return iexId;
}

public String getRegion() {
return region;
}

public String getCurrency() {
return currency;
}

public String getFigi() {
return figi;
}

public String getCik() {
return cik;
}

public String getLei() {
return lei;
}

public String getSecurityName() {
return securityName;
}

public SymbolType getSecurityType() {
return securityType;
}

public String getSector() {
return sector;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
Expand All @@ -82,33 +132,40 @@ public boolean equals(final Object o) {
return false;
}
final SymbolDescription that = (SymbolDescription) o;
return Objects.equal(symbol, that.symbol) &&
Objects.equal(cik, that.cik) &&
Objects.equal(securityName, that.securityName) &&
securityType == that.securityType &&
Objects.equal(region, that.region) &&
Objects.equal(sector, that.sector) &&
Objects.equal(exchange, that.exchange) &&
Objects.equal(currency, that.currency);
return Objects.equals(symbol, that.symbol) && Objects.equals(exchange, that.exchange) &&
Objects.equals(exchangeSuffix, that.exchangeSuffix) &&
Objects.equals(exchangeName, that.exchangeName) && Objects.equals(name, that.name) &&
Objects.equals(type, that.type) && Objects.equals(iexId, that.iexId) &&
Objects.equals(region, that.region) && Objects.equals(currency, that.currency) &&
Objects.equals(figi, that.figi) && Objects.equals(cik, that.cik) &&
Objects.equals(lei, that.lei) && Objects.equals(securityName, that.securityName) &&
securityType == that.securityType && Objects.equals(sector, that.sector);
}

@Override
public int hashCode() {
return Objects.hashCode(symbol, cik, securityName, securityType, region, exchange, sector, currency);
return Objects.hash(symbol, exchange, exchangeSuffix, exchangeName, name, type, iexId,
region, currency, figi, cik, lei, securityName, securityType, sector);
}

@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("symbol", symbol)
.add("cik", cik)
.add("securityName", securityName)
.add("securityType", securityType)
.add("region", region)
.add("exchange", exchange)
.add("sector", sector)
.add("currency", currency)
return new StringJoiner(", ", SymbolDescription.class.getSimpleName() + "[", "]")
.add("symbol='" + symbol + "'")
.add("exchange='" + exchange + "'")
.add("exchangeSuffix='" + exchangeSuffix + "'")
.add("exchangeName='" + exchangeName + "'")
.add("name='" + name + "'")
.add("type='" + type + "'")
.add("iexId='" + iexId + "'")
.add("region='" + region + "'")
.add("currency='" + currency + "'")
.add("figi='" + figi + "'")
.add("cik='" + cik + "'")
.add("lei='" + lei + "'")
.add("securityName='" + securityName + "'")
.add("securityType=" + securityType)
.add("sector='" + sector + "'")
.toString();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,38 @@ public class SymbolDescriptionTest {
@Test
void constructor() {
final String symbol = fixture.create(String.class);
final String exchange = fixture.create(String.class);
final String exchangeSuffix = fixture.create(String.class);
final String exchangeName = fixture.create(String.class);
final String name = fixture.create(String.class);
final String type = fixture.create(String.class);
final String iexId = fixture.create(String.class);
final String region = fixture.create(String.class);
final String currency = fixture.create(String.class);
final String figi = fixture.create(String.class);
final String cik = fixture.create(String.class);
final String lei = fixture.create(String.class);
final String securityName = fixture.create(String.class);
final SymbolType securityType = fixture.create(SymbolType.class);
final String region = fixture.create(String.class);
final String exchange = fixture.create(String.class);
final String sector = fixture.create(String.class);
final String currency = fixture.create(String.class);

final SymbolDescription symbolDescription = new SymbolDescription(symbol, cik, securityName,
securityType, region, exchange, sector, currency);
final SymbolDescription symbolDescription = new SymbolDescription(symbol, exchange, exchangeSuffix,
exchangeName, name, type, iexId, region, currency, figi, cik, lei, securityName, securityType,
sector);

assertThat(symbolDescription.getSymbol()).isEqualTo(symbol);
assertThat(symbolDescription.getExchange()).isEqualTo(exchange);
assertThat(symbolDescription.getExchangeSuffix()).isEqualTo(exchangeSuffix);
assertThat(symbolDescription.getExchangeName()).isEqualTo(exchangeName);
assertThat(symbolDescription.getName()).isEqualTo(name);
assertThat(symbolDescription.getType()).isEqualTo(type);
assertThat(symbolDescription.getIexId()).isEqualTo(iexId);
assertThat(symbolDescription.getFigi()).isEqualTo(figi);
assertThat(symbolDescription.getCik()).isEqualTo(cik);
assertThat(symbolDescription.getLei()).isEqualTo(lei);
assertThat(symbolDescription.getSecurityName()).isEqualTo(securityName);
assertThat(symbolDescription.getSecurityType()).isEqualTo(securityType);
assertThat(symbolDescription.getRegion()).isEqualTo(region);
assertThat(symbolDescription.getExchange()).isEqualTo(exchange);
assertThat(symbolDescription.getSector()).isEqualTo(sector);
assertThat(symbolDescription.getCurrency()).isEqualTo(currency);
}
Expand Down
2 changes: 1 addition & 1 deletion iextrading4j-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.4.3</version>
<version>3.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion iextrading4j-mutation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.4.3</version>
<version>3.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions iextrading4j-samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.4.3</version>
<version>3.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>pl.zankowski</groupId>
<artifactId>iextrading4j-client</artifactId>
<version>3.4.3</version>
<version>3.4.4</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion iextrading4j-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.4.3</version>
<version>3.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading

0 comments on commit f1ab9a1

Please sign in to comment.