@Test public void valueOf_nullCurrency_nullReturned() { assertThat(Money.valueOf(null, 123)).isNull(); }
public static Money valueOf(Currency currency, Integer value) { if (currency == null || value == null) { return null; } else { return new Money(currency, value); } }
Money implements ValueObject { public static Money valueOf(Currency currency, Integer value) { if (currency == null || value == null) { return null; } else { return new Money(currency, value); } } }
Money implements ValueObject { public static Money valueOf(Currency currency, Integer value) { if (currency == null || value == null) { return null; } else { return new Money(currency, value); } } @JsonCreator  Money(@NonNull @JsonProperty("currency") Currency currency, @JsonProperty("amount") int amount);  Money(@NonNull Currency currency, double amount); }
Money implements ValueObject { public static Money valueOf(Currency currency, Integer value) { if (currency == null || value == null) { return null; } else { return new Money(currency, value); } } @JsonCreator  Money(@NonNull @JsonProperty("currency") Currency currency, @JsonProperty("amount") int amount);  Money(@NonNull Currency currency, double amount); static Money valueOf(Currency currency, Integer value); @NonNull Money add(@NonNull Money augend); @NonNull Money subtract(@NonNull Money subtrahend); @NonNull Money multiply(int multiplicand); @NonNull Currency currency(); int fixedPointAmount(); double doubleAmount(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Money implements ValueObject { public static Money valueOf(Currency currency, Integer value) { if (currency == null || value == null) { return null; } else { return new Money(currency, value); } } @JsonCreator  Money(@NonNull @JsonProperty("currency") Currency currency, @JsonProperty("amount") int amount);  Money(@NonNull Currency currency, double amount); static Money valueOf(Currency currency, Integer value); @NonNull Money add(@NonNull Money augend); @NonNull Money subtract(@NonNull Money subtrahend); @NonNull Money multiply(int multiplicand); @NonNull Currency currency(); int fixedPointAmount(); double doubleAmount(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }