Skip to content

Commit

Permalink
Small update.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfries committed Mar 5, 2024
1 parent c500b4f commit 1a41db1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 91 deletions.
102 changes: 11 additions & 91 deletions src/main/java/net/finmath/smartcontract/settlement/Settlement.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@
*/
public class Settlement {

public enum SettlementType {
INITIAL,
REGULAR,
TERMINAL
}

private String tradeId;

private SettlementType settlementType;

private String currency;

private BigDecimal marginValue;
Expand All @@ -36,16 +44,16 @@ public class Settlement {

/// V(T1,M0)

private String marketDataPrevious;

private BigDecimal settlementValuePrevious;

/// V(T2,M1)
/// V(T2,M1) - indicative

private ZonedDateTime settlementTimeNext;

private BigDecimal settlementValueNext;

// Custom additional information (e.g. risk figures or szenario values)

private Map<String, String> info;

public String getTradeId() {
Expand All @@ -55,93 +63,5 @@ public String getTradeId() {
public void setTradeId(String tradeId) {
this.tradeId = tradeId;
}

public String getCurrency() {
return currency;
}

public void setCurrency(String currency) {
this.currency = currency;
}

public BigDecimal getMarginValue() {
return marginValue;
}

public void setMarginValue(BigDecimal marginValue) {
this.marginValue = marginValue;
}

public List<BigDecimal> getMarginLimits() {
return marginLimits;
}

public void setMarginLimits(List<BigDecimal> marginLimits) {
this.marginLimits = marginLimits;
}

public ZonedDateTime getSettlementTime() {
return settlementTime;
}

public void setSettlementTime(ZonedDateTime settlementTime) {
this.settlementTime = settlementTime;
}

public String getMarketData() {
return marketData;
}

public void setMarketData(String marketData) {
this.marketData = marketData;
}

public BigDecimal getSettlementValue() {
return settlementValue;
}

public void setSettlementValue(BigDecimal settlementValue) {
this.settlementValue = settlementValue;
}

public String getMarketDataPrevious() {
return marketDataPrevious;
}

public void setMarketDataPrevious(String marketDataPrevious) {
this.marketDataPrevious = marketDataPrevious;
}

public BigDecimal getSettlementValuePrevious() {
return settlementValuePrevious;
}

public void setSettlementValuePrevious(BigDecimal settlementValuePrevious) {
this.settlementValuePrevious = settlementValuePrevious;
}

public ZonedDateTime getSettlementTimeNext() {
return settlementTimeNext;
}

public void setSettlementTimeNext(ZonedDateTime settlementTimeNext) {
this.settlementTimeNext = settlementTimeNext;
}

public BigDecimal getSettlementValueNext() {
return settlementValueNext;
}

public void setSettlementValueNext(BigDecimal settlementValueNext) {
this.settlementValueNext = settlementValueNext;
}

public Map<String, String> getInfo() {
return info;
}

public void setInfo(Map<String, String> info) {
this.info = info;
}
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.finmath.smartcontract.settlement;

import java.util.List;
import java.util.Optional;

/**
* Collection of settlements.
Expand All @@ -16,4 +17,16 @@ public List<Settlement> getSettlements() {
public void setSettlements(List<Settlement> settlements) {
this.settlements = settlements;
}

public Optional<Settlement> getPrevious(Settlement settlement) {
int currentIndex = settlements.indexOf(settlement);
if (currentIndex <= 0) return Optional.empty();
else return Optional.of(settlements.get(currentIndex - 1));
}

public Optional<Settlement> getNext(Settlement settlement) {
int currentIndex = settlements.indexOf(settlement);
if (currentIndex > settlements.size() - 2) return Optional.empty();
else return Optional.of(settlements.get(currentIndex + 1));
}
}

0 comments on commit 1a41db1

Please sign in to comment.