Value implements Serializable { public static Value of(String s) { return new StringValue(s); }  static Value of(String s); static Value of(Date d); static Value of(double d); static Value of(long l); static Value of(boolean b); static Value of(int i); static Value of(Object o); @JsonIgnore long getId(); void setId(long id); @JsonIgnore abstract Object getAsObject(); @JsonIgnore Long getAsLong(); void setAsLong(Long value); @JsonIgnore String getAsString(); void setAsString(String value); @JsonIgnore Double getAsDouble(); void setAsDouble(Double value); @JsonIgnore Date getAsDate(); void setAsDate(Date value); @JsonIgnore boolean getAsBoolean(); void setAsBoolean(boolean value); abstract Value copy(); abstract T accept(ValueVisitor<T> visitor); Object getAsDataType(DataType dataType);  }
@Test(expected = InvalidParameterException.class) public void ofObject_fails() { Object o = Instant.now(); Value.of(o); }
@Test public void ofNull() { Object o = null; Value.of(o); }