Skip to content

Commit f640a2e

Browse files
committed
2: Adjust to API changes Fixed JavaDoc and User Guide
1 parent df5dc1c commit f640a2e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/main/asciidoc/userguide.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ Additionally _Moneta_ also supports static factory methods on the types directly
299299
[source,java]
300300
.Creating instances of +FastMoney+ using the +MonetaryAmounts+ singleton:
301301
--------------------------------------------
302-
FastMoney m = FastMoney.of("USD", 200.20);
302+
FastMoney m = FastMoney.of(200.20, "USD");
303303
--------------------------------------------
304304

305305
Creation of +Money+ instances is similar:
@@ -308,7 +308,7 @@ Creation of +Money+ instances is similar:
308308
.Creating instances of +Money+:
309309
--------------------------------------------
310310
Money m1 = Monetary.getAmountFactory(Money.class).setCurrency("USD").setNumber(200.20).create();
311-
Money m2 = Money.of("USD", 200.20);
311+
Money m2 = Money.of(200.20, "USD");
312312
--------------------------------------------
313313

314314
===== Configuring Instances of Money
@@ -321,7 +321,7 @@ explicitly by passing a +MathContext+ as part of a +MonetaryContext+:
321321
[source,java]
322322
.Creating instances of +Money+ configuring the +MathContext+ to be used.
323323
--------------------------------------------
324-
Money money = Money.of("CHF", 200, MonetaryContextBuilder.create().set(MathContext.DECIMAL128).build());
324+
Money money = Money.of(200, "CHF", MonetaryContextBuilder.create().set(MathContext.DECIMAL128).build());
325325
--------------------------------------------
326326

327327
Using the JSR's main API allows to achieve the same as follows:

src/main/java/org/javamoney/moneta/FastMoney.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
* different results:
4040
* </p>
4141
* <pre><code>
42-
* Money money1 = money1.add(Money.of("EUR", 1234567.3444));
43-
* money1 = money1.subtract(Money.of("EUR", 232323));
42+
* Money money1 = money1.add(Money.of(1234567.3444, "EUR"));
43+
* money1 = money1.subtract(Money.of(232323, "EUR"));
4444
* money1 = money1.multiply(3.4);
4545
* money1 = money1.divide(5.456);
4646
* </code></pre>
@@ -51,8 +51,8 @@
5151
* whereas
5252
* </p>
5353
* <pre><code>
54-
* FastMoney money1 = money1.add(FastMoney.of("EUR", 1234567.3444));
55-
* money1 = money1.subtract(FastMoney.of("EUR", 232323));
54+
* FastMoney money1 = money1.add(FastMoney.of(1234567.3444, "EUR"));
55+
* money1 = money1.subtract(FastMoney.of(232323, "EUR"));
5656
* money1 = money1.multiply(3.4);
5757
* money1 = money1.divide(5.456);
5858
* </code></pre>
@@ -64,8 +64,8 @@
6464
* code above with the following: *
6565
* </p>
6666
* <pre><code>
67-
* FastMoney money1 = money1.add(Money.of("EUR", 1234567.3444));
68-
* money1 = money1.subtract(FastMoney.of("EUR", 232323));
67+
* FastMoney money1 = money1.add(Money.of(1234567.3444, "EUR"));
68+
* money1 = money1.subtract(FastMoney.of(232323, "EUR"));
6969
* money1 = money1.multiply(3.4);
7070
* money1 = money1.divide(5.456);
7171
* </code></pre>
@@ -78,7 +78,7 @@
7878
*
7979
* @author Anatole Tresch
8080
* @author Werner Keil
81-
* @version 0.5.2
81+
* @version 1.0
8282
*/
8383
public final class FastMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable {
8484

0 commit comments

Comments
 (0)