mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
No effective change - format code
This commit is contained in:
@@ -4,25 +4,24 @@ import java.util.Currency;
|
||||
|
||||
/**
|
||||
* Currency and Money.
|
||||
*
|
||||
* @author rbygrave
|
||||
*
|
||||
* @author rbygrave
|
||||
*/
|
||||
public class CMoney {
|
||||
|
||||
private final Money amount;
|
||||
private final Currency currency;
|
||||
|
||||
public CMoney(Money amount, Currency currency) {
|
||||
this.amount = amount;
|
||||
this.currency = currency;
|
||||
}
|
||||
private final Money amount;
|
||||
private final Currency currency;
|
||||
|
||||
public Money getAmount() {
|
||||
return amount;
|
||||
}
|
||||
public CMoney(Money amount, Currency currency) {
|
||||
this.amount = amount;
|
||||
this.currency = currency;
|
||||
}
|
||||
|
||||
public Currency getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
public Money getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public Currency getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.avaje.tests.model.ivo;
|
||||
|
||||
/**
|
||||
@@ -6,42 +5,42 @@ package com.avaje.tests.model.ivo;
|
||||
*/
|
||||
public class ExhangeCMoneyRate {
|
||||
|
||||
private final Rate rate;
|
||||
private final CMoney cmoney;
|
||||
|
||||
public ExhangeCMoneyRate(Rate rate, CMoney cmoney) {
|
||||
this.rate = rate;
|
||||
this.cmoney = cmoney;
|
||||
}
|
||||
private final Rate rate;
|
||||
private final CMoney cmoney;
|
||||
|
||||
public Rate getRate() {
|
||||
return rate;
|
||||
}
|
||||
public ExhangeCMoneyRate(Rate rate, CMoney cmoney) {
|
||||
this.rate = rate;
|
||||
this.cmoney = cmoney;
|
||||
}
|
||||
|
||||
public CMoney getCmoney() {
|
||||
return cmoney;
|
||||
}
|
||||
public Rate getRate() {
|
||||
return rate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof ExhangeCMoneyRate){
|
||||
ExhangeCMoneyRate e = (ExhangeCMoneyRate)obj;
|
||||
return e.rate.equals(rate) && e.cmoney.equals(cmoney);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public CMoney getCmoney() {
|
||||
return cmoney;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hc = rate.hashCode();
|
||||
hc = hc * 31 + cmoney.hashCode();
|
||||
return hc;
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof ExhangeCMoneyRate) {
|
||||
ExhangeCMoneyRate e = (ExhangeCMoneyRate) obj;
|
||||
return e.rate.equals(rate) && e.cmoney.equals(cmoney);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hc = rate.hashCode();
|
||||
hc = hc * 31 + cmoney.hashCode();
|
||||
return hc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "rate=" + rate + " cmoney=" + cmoney;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "rate="+rate+" cmoney="+cmoney;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,134 +9,133 @@ import java.util.Iterator;
|
||||
/**
|
||||
* A representation of Money effectively wrapping BigDecimal.
|
||||
* <p>
|
||||
*
|
||||
* <p>
|
||||
* </p>
|
||||
* @author rbygrave
|
||||
*
|
||||
* @author rbygrave
|
||||
*/
|
||||
public final class Money implements Comparable<Money>, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final Money ZERO = new Money(BigDecimal.ZERO);
|
||||
|
||||
private final BigDecimal amount;
|
||||
|
||||
public Money(BigDecimal amount) {
|
||||
if (amount == null){
|
||||
throw new NullPointerException("amount can not be null");
|
||||
}
|
||||
this.amount = amount;
|
||||
}
|
||||
public static final Money ZERO = new Money(BigDecimal.ZERO);
|
||||
|
||||
public Money(double val) {
|
||||
this(BigDecimal.valueOf(val));
|
||||
}
|
||||
private final BigDecimal amount;
|
||||
|
||||
public Money(String val) {
|
||||
this(new BigDecimal(val));
|
||||
public Money(BigDecimal amount) {
|
||||
if (amount == null) {
|
||||
throw new NullPointerException("amount can not be null");
|
||||
}
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return amount.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return amount.hashCode();
|
||||
}
|
||||
public Money(double val) {
|
||||
this(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Money){
|
||||
// use BigDecimal.compareTo to handle scale differences
|
||||
return amount.compareTo(((Money)obj).getAmount()) == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public Money(String val) {
|
||||
this(new BigDecimal(val));
|
||||
}
|
||||
|
||||
public int compareTo(Money o) {
|
||||
return amount.compareTo(o.amount);
|
||||
}
|
||||
public String toString() {
|
||||
return amount.toString();
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public Money subtract(Money amt){
|
||||
BigDecimal b = amount.subtract(amt.amount);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Money subtract(Money amt, MathContext ctx){
|
||||
BigDecimal b = amount.subtract(amt.amount, ctx);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Money add(Money amt){
|
||||
BigDecimal b = amount.add(amt.amount);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Money add(Money amt, MathContext ctx){
|
||||
BigDecimal b = amount.add(amt.amount, ctx);
|
||||
return new Money(b);
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return amount.hashCode();
|
||||
}
|
||||
|
||||
public Money multiply(Money m){
|
||||
return multiply(m.amount);
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Money) {
|
||||
// use BigDecimal.compareTo to handle scale differences
|
||||
return amount.compareTo(((Money) obj).getAmount()) == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Money multiply(int val){
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
public int compareTo(Money o) {
|
||||
return amount.compareTo(o.amount);
|
||||
}
|
||||
|
||||
public Money multiply(float val){
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public Money multiply(double val){
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
public Money multiply(BigDecimal m){
|
||||
BigDecimal b = amount.multiply(m);
|
||||
return new Money(b);
|
||||
}
|
||||
public Money subtract(Money amt) {
|
||||
BigDecimal b = amount.subtract(amt.amount);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Money divide(BigDecimal divisor){
|
||||
BigDecimal b = amount.divide(divisor);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Money divide(BigDecimal divisor, MathContext ctx){
|
||||
BigDecimal b = amount.divide(divisor, ctx);
|
||||
return new Money(b);
|
||||
}
|
||||
public Money subtract(Money amt, MathContext ctx) {
|
||||
BigDecimal b = amount.subtract(amt.amount, ctx);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public static Money sum(Money... m){
|
||||
BigDecimal t = BigDecimal.ZERO;
|
||||
for (Money money : m) {
|
||||
t = t.add(money.amount);
|
||||
}
|
||||
return new Money(t);
|
||||
public Money add(Money amt) {
|
||||
BigDecimal b = amount.add(amt.amount);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Money add(Money amt, MathContext ctx) {
|
||||
BigDecimal b = amount.add(amt.amount, ctx);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Money multiply(Money m) {
|
||||
return multiply(m.amount);
|
||||
}
|
||||
|
||||
public Money multiply(int val) {
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
public Money multiply(float val) {
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
public Money multiply(double val) {
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
public Money multiply(BigDecimal m) {
|
||||
BigDecimal b = amount.multiply(m);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Money divide(BigDecimal divisor) {
|
||||
BigDecimal b = amount.divide(divisor);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Money divide(BigDecimal divisor, MathContext ctx) {
|
||||
BigDecimal b = amount.divide(divisor, ctx);
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public static Money sum(Money... m) {
|
||||
BigDecimal t = BigDecimal.ZERO;
|
||||
for (Money money : m) {
|
||||
t = t.add(money.amount);
|
||||
}
|
||||
|
||||
public static Money sum(Iterator<Money> it){
|
||||
BigDecimal t = BigDecimal.ZERO;
|
||||
while (it.hasNext()) {
|
||||
t = t.add(it.next().amount);
|
||||
}
|
||||
return new Money(t);
|
||||
return new Money(t);
|
||||
}
|
||||
|
||||
public static Money sum(Iterator<Money> it) {
|
||||
BigDecimal t = BigDecimal.ZERO;
|
||||
while (it.hasNext()) {
|
||||
t = t.add(it.next().amount);
|
||||
}
|
||||
|
||||
public static Money sum(Iterator<Money> it, MathContext ctx){
|
||||
BigDecimal t = BigDecimal.ZERO;
|
||||
while (it.hasNext()) {
|
||||
t = t.add(it.next().amount, ctx);
|
||||
}
|
||||
return new Money(t);
|
||||
return new Money(t);
|
||||
}
|
||||
|
||||
public static Money sum(Iterator<Money> it, MathContext ctx) {
|
||||
BigDecimal t = BigDecimal.ZERO;
|
||||
while (it.hasNext()) {
|
||||
t = t.add(it.next().amount, ctx);
|
||||
}
|
||||
return new Money(t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,43 +3,43 @@ package com.avaje.tests.model.ivo;
|
||||
|
||||
public class Oid<T> {
|
||||
|
||||
private final long value;
|
||||
private final long value;
|
||||
|
||||
public Oid(long value) {
|
||||
this.value = value;
|
||||
}
|
||||
public Oid(long value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public long getValue() {
|
||||
return value;
|
||||
}
|
||||
public long getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int) (value ^ (value >>> 32));
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int) (value ^ (value >>> 32));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof Oid<?>) {
|
||||
return ((Oid<?>) o).value == value;
|
||||
}
|
||||
return false;
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof Oid<?>) {
|
||||
return ((Oid<?>) o).value == value;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Oid<?> valueOf(String s) {
|
||||
return new Oid<Object>(Integer.valueOf(s));
|
||||
}
|
||||
public static Oid<?> valueOf(String s) {
|
||||
return new Oid<Object>(Integer.valueOf(s));
|
||||
}
|
||||
|
||||
public static Oid<?> valueOf(long i) {
|
||||
return new Oid<Object>(i);
|
||||
}
|
||||
public static Oid<?> valueOf(long i) {
|
||||
return new Oid<Object>(i);
|
||||
}
|
||||
|
||||
public static <T> Oid<T> valueOf(Class<T> cls, String s) {
|
||||
Integer v = Integer.valueOf(s);
|
||||
return new Oid<T>(v);
|
||||
}
|
||||
public static <T> Oid<T> valueOf(Class<T> cls, String s) {
|
||||
Integer v = Integer.valueOf(s);
|
||||
return new Oid<T>(v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,120 +15,120 @@ import java.math.MathContext;
|
||||
* Rates are typically used to multiple or divide against an amount.
|
||||
* For example, you can't ADD a Rate to Money.
|
||||
* </p>
|
||||
* @author rbygrave
|
||||
*
|
||||
* @author rbygrave
|
||||
*/
|
||||
public final class Rate implements Comparable<Rate>, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final Rate ZERO = new Rate(BigDecimal.ZERO);
|
||||
public static final Rate ONE = new Rate(BigDecimal.ONE);
|
||||
|
||||
private final BigDecimal value;
|
||||
|
||||
public Rate(BigDecimal value) {
|
||||
if (value == null){
|
||||
throw new NullPointerException("value can not be null");
|
||||
}
|
||||
this.value = value;
|
||||
}
|
||||
public static final Rate ZERO = new Rate(BigDecimal.ZERO);
|
||||
public static final Rate ONE = new Rate(BigDecimal.ONE);
|
||||
|
||||
public Rate(double val) {
|
||||
this(BigDecimal.valueOf(val));
|
||||
}
|
||||
private final BigDecimal value;
|
||||
|
||||
public Rate(String val) {
|
||||
this(new BigDecimal(val));
|
||||
public Rate(BigDecimal value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException("value can not be null");
|
||||
}
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
public int compareTo(Rate o) {
|
||||
return value.compareTo(o.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return value.hashCode();
|
||||
}
|
||||
public Rate(double val) {
|
||||
this(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Rate){
|
||||
// use BigDecimal.compareTo to handle scale differences
|
||||
return value.compareTo(((Rate)obj).getValue()) == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public Rate(String val) {
|
||||
this(new BigDecimal(val));
|
||||
}
|
||||
|
||||
public BigDecimal getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Rate subtract(Rate amt){
|
||||
BigDecimal b = value.subtract(amt.value);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
public Rate subtract(Rate amt, MathContext ctx){
|
||||
BigDecimal b = value.subtract(amt.value, ctx);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
public Rate add(Rate amt){
|
||||
BigDecimal b = value.add(amt.value);
|
||||
return new Rate(b);
|
||||
}
|
||||
public String toString() {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
public Rate add(Rate amt, MathContext ctx){
|
||||
BigDecimal b = value.add(amt.value, ctx);
|
||||
return new Rate(b);
|
||||
}
|
||||
public int compareTo(Rate o) {
|
||||
return value.compareTo(o.value);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Rate times Money amount returns Money.
|
||||
*/
|
||||
public Money times(Money amount){
|
||||
return multiply(amount);
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return value.hashCode();
|
||||
}
|
||||
|
||||
public Money multiply(Money amount){
|
||||
BigDecimal b = value.multiply(amount.getAmount());
|
||||
return new Money(b);
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Rate) {
|
||||
// use BigDecimal.compareTo to handle scale differences
|
||||
return value.compareTo(((Rate) obj).getValue()) == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Rate multiply(Rate m){
|
||||
return multiply(m.value);
|
||||
}
|
||||
public BigDecimal getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Rate multiply(int val){
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
public Rate subtract(Rate amt) {
|
||||
BigDecimal b = value.subtract(amt.value);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
public Rate multiply(float val){
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
public Rate subtract(Rate amt, MathContext ctx) {
|
||||
BigDecimal b = value.subtract(amt.value, ctx);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
public Rate multiply(double val){
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
public Rate multiply(BigDecimal m){
|
||||
BigDecimal b = value.multiply(m);
|
||||
return new Rate(b);
|
||||
}
|
||||
public Rate add(Rate amt) {
|
||||
BigDecimal b = value.add(amt.value);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
public Rate divide(BigDecimal divisor){
|
||||
BigDecimal b = value.divide(divisor);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
public Rate divide(BigDecimal divisor, MathContext ctx){
|
||||
BigDecimal b = value.divide(divisor, ctx);
|
||||
return new Rate(b);
|
||||
}
|
||||
public Rate add(Rate amt, MathContext ctx) {
|
||||
BigDecimal b = value.add(amt.value, ctx);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Rate times Money amount returns Money.
|
||||
*/
|
||||
public Money times(Money amount) {
|
||||
return multiply(amount);
|
||||
}
|
||||
|
||||
public Money multiply(Money amount) {
|
||||
BigDecimal b = value.multiply(amount.getAmount());
|
||||
return new Money(b);
|
||||
}
|
||||
|
||||
public Rate multiply(Rate m) {
|
||||
return multiply(m.value);
|
||||
}
|
||||
|
||||
public Rate multiply(int val) {
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
public Rate multiply(float val) {
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
public Rate multiply(double val) {
|
||||
return multiply(BigDecimal.valueOf(val));
|
||||
}
|
||||
|
||||
public Rate multiply(BigDecimal m) {
|
||||
BigDecimal b = value.multiply(m);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
public Rate divide(BigDecimal divisor) {
|
||||
BigDecimal b = value.divide(divisor);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
public Rate divide(BigDecimal divisor, MathContext ctx) {
|
||||
BigDecimal b = value.divide(divisor, ctx);
|
||||
return new Rate(b);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,18 +5,18 @@ package com.avaje.tests.model.ivo;
|
||||
*/
|
||||
public class Segment {
|
||||
|
||||
private final String code;
|
||||
|
||||
public Segment(String code){
|
||||
this.code = code;
|
||||
}
|
||||
private final String code;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
public Segment(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return code;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,27 +4,27 @@ import com.avaje.ebeaninternal.server.type.reflect.KnownImmutable;
|
||||
|
||||
public class SimpleKnownImmutable implements KnownImmutable {
|
||||
|
||||
public boolean isKnownImmutable(Class<?> cls) {
|
||||
|
||||
// Check for all allowed property types...
|
||||
if (cls.isPrimitive() || String.class.equals(cls) || Object.class.equals(cls)) {
|
||||
return true;
|
||||
}
|
||||
if (java.util.Date.class.equals(cls) || java.sql.Date.class.equals(cls) || java.sql.Timestamp.class.equals(cls)) {
|
||||
// treat as immutable even through they are not strictly so
|
||||
return true;
|
||||
}
|
||||
if (java.math.BigDecimal.class.equals(cls) || java.math.BigInteger.class.equals(cls)) {
|
||||
// treat as immutable (contain non-final fields)
|
||||
return true;
|
||||
}
|
||||
public boolean isKnownImmutable(Class<?> cls) {
|
||||
|
||||
if (Integer.class.equals(cls) || Long.class.equals(cls) || Double.class.equals(cls) || Float.class.equals(cls)
|
||||
|| Short.class.equals(cls) || Byte.class.equals(cls) || Character.class.equals(cls)
|
||||
|| Boolean.class.equals(cls)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
// Check for all allowed property types...
|
||||
if (cls.isPrimitive() || String.class.equals(cls) || Object.class.equals(cls)) {
|
||||
return true;
|
||||
}
|
||||
if (java.util.Date.class.equals(cls) || java.sql.Date.class.equals(cls) || java.sql.Timestamp.class.equals(cls)) {
|
||||
// treat as immutable even through they are not strictly so
|
||||
return true;
|
||||
}
|
||||
if (java.math.BigDecimal.class.equals(cls) || java.math.BigInteger.class.equals(cls)) {
|
||||
// treat as immutable (contain non-final fields)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Integer.class.equals(cls) || Long.class.equals(cls) || Double.class.equals(cls) || Float.class.equals(cls)
|
||||
|| Short.class.equals(cls) || Byte.class.equals(cls) || Character.class.equals(cls)
|
||||
|| Boolean.class.equals(cls)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@ package com.avaje.tests.model.ivo;
|
||||
|
||||
public class SysTime {
|
||||
|
||||
private final long millis;
|
||||
|
||||
public SysTime(long millis){
|
||||
this.millis = millis;
|
||||
}
|
||||
private final long millis;
|
||||
|
||||
public SysTime(long millis) {
|
||||
this.millis = millis;
|
||||
}
|
||||
|
||||
public long getMillis() {
|
||||
return millis;
|
||||
}
|
||||
|
||||
public long getMillis() {
|
||||
return millis;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
package com.avaje.tests.model.ivo;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Currency;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebeaninternal.server.type.reflect.CheckImmutable;
|
||||
import com.avaje.ebeaninternal.server.type.reflect.CheckImmutableResponse;
|
||||
import com.avaje.ebeaninternal.server.type.reflect.ImmutableMeta;
|
||||
import com.avaje.ebeaninternal.server.type.reflect.ImmutableMetaFactory;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Currency;
|
||||
|
||||
public class TestCheckImmutable extends BaseTestCase {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user