-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/leg_valuation_and_code_cleanup' into develop
- Loading branch information
Showing
49 changed files
with
704 additions
and
209 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
24 changes: 24 additions & 0 deletions
24
src/main/java/net/finmath/smartcontract/settlement/BigDecimalAdapter.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,24 @@ | ||
package net.finmath.smartcontract.settlement; | ||
|
||
import jakarta.xml.bind.annotation.adapters.XmlAdapter; | ||
|
||
import java.math.BigDecimal; | ||
|
||
public class BigDecimalAdapter extends XmlAdapter<String, BigDecimal> { | ||
|
||
@Override | ||
public String marshal(BigDecimal value) throws Exception | ||
{ | ||
if (value!= null) | ||
{ | ||
return value.toString(); | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public BigDecimal unmarshal(String s) throws Exception | ||
{ | ||
return new BigDecimal(s); | ||
} | ||
} |
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
41 changes: 41 additions & 0 deletions
41
src/main/java/net/finmath/smartcontract/settlement/SettlementInfo.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,41 @@ | ||
package net.finmath.smartcontract.settlement; | ||
|
||
import jakarta.xml.bind.annotation.XmlAttribute; | ||
import jakarta.xml.bind.annotation.XmlRootElement; | ||
import jakarta.xml.bind.annotation.XmlValue; | ||
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | ||
|
||
import java.math.BigDecimal; | ||
|
||
@XmlRootElement(name="settlementInfo") | ||
public class SettlementInfo { | ||
|
||
private String key; | ||
private BigDecimal value; | ||
|
||
public SettlementInfo() { } | ||
|
||
public SettlementInfo(String key, BigDecimal value) { | ||
this.key = key; | ||
this.value = value; | ||
} | ||
|
||
@XmlAttribute | ||
public String getKey() { | ||
return key; | ||
} | ||
|
||
public void setKey(String key) { | ||
this.key = key; | ||
} | ||
|
||
@XmlValue | ||
@XmlJavaTypeAdapter(BigDecimalAdapter.class) | ||
public BigDecimal getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(BigDecimal value) { | ||
this.value = value; | ||
} | ||
} |
Oops, something went wrong.