/** * Creates a new BigDecimal-valued OData property with {@link EdmSimpleType#DECIMAL} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<BigDecimal> decimal(String name, double value) { return new Impl<BigDecimal>(name, EdmSimpleType.DECIMAL, BigDecimal.valueOf(value)); }
@Override public String toString() { return String.format("OProperty[%s,%s,%s]", name, getType(), OSimpleObjects.getValueDisplayString(value)); } }
/** * Creates a new byte-valued OData property with {@link EdmSimpleType#SBYTE} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<Byte> sbyte_(String name, byte value) { return new Impl<Byte>(name, EdmSimpleType.SBYTE, value); }
/** * Creates a new LocalTime-valued OData property with {@link EdmSimpleType#TIME} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<LocalTime> time(String name, LocalTime value) { return new Impl<LocalTime>(name, EdmSimpleType.TIME, value); }
/** * Creates a new LocalDateTime-valued OData property with {@link EdmSimpleType#DATETIME} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<LocalDateTime> datetime(String name, Time value) { return new Impl<LocalDateTime>(name, EdmSimpleType.DATETIME, value != null ? new LocalDateTime(value) : null); }
/** * Creates a new double-precision-valued OData property with {@link EdmSimpleType#DOUBLE} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<Double> double_(String name, Double value) { return new Impl<Double>(name, EdmSimpleType.DOUBLE, value); }
/** * Creates a new Guid-valued OData property with {@link EdmSimpleType#GUID} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<Guid> guid(String name, Guid value) { return new Impl<Guid>(name, EdmSimpleType.GUID, value); }
/** * Creates a new OData property of the given edm simple type with a null value. * * @param name the property name * @param fqSimpleTypeName the property edm simple type * @return a new OData property instance */ public static OProperty<?> null_(String name, String fqSimpleTypeName) { return new Impl<Object>(name, EdmType.getSimple(fqSimpleTypeName), null); }
/** * Creates a new byte-array-valued OData property with {@link EdmSimpleType#BINARY} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<Byte[]> binary(String name, Byte[] value) { return new Impl<Byte[]>(name, EdmSimpleType.BINARY, value); }
/** * Creates a new BigDecimal-valued OData property with {@link EdmSimpleType#DECIMAL} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<BigDecimal> decimal(String name, BigInteger value) { return new Impl<BigDecimal>(name, EdmSimpleType.DECIMAL, value != null ? BigDecimal.valueOf(value.longValue()) : null); }
/** * Creates a new LocalTime-valued OData property with {@link EdmSimpleType#TIME} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<LocalTime> time(String name, Timestamp value) { return new Impl<LocalTime>(name, EdmSimpleType.TIME, value != null ? new LocalTime(value) : null); }
/** * Creates a new LocalTime-valued OData property with {@link EdmSimpleType#TIME} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<LocalTime> time(String name, Calendar value) { return new Impl<LocalTime>(name, EdmSimpleType.TIME, value != null ? LocalTime.fromCalendarFields(value) : null); }
/** * Creates a new LocalDateTime-valued OData property with {@link EdmSimpleType#DATETIME} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<LocalDateTime> datetime(String name, Time value) { return new Impl<LocalDateTime>(name, EdmSimpleType.DATETIME, value != null ? new LocalDateTime(value) : null); }
/** * Creates a new LocalDateTime-valued OData property with {@link EdmSimpleType#DATETIME} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<LocalDateTime> datetime(String name, Date value) { return new Impl<LocalDateTime>(name, EdmSimpleType.DATETIME, value != null ? LocalDateTime.fromDateFields(value) : null); }
/** * Creates a new Guid-valued OData property with {@link EdmSimpleType#GUID} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<Guid> guid(String name, Guid value) { return new Impl<Guid>(name, EdmSimpleType.GUID, value); }
/** * Creates a new String-valued OData property with {@link EdmSimpleType#STRING} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<Character> character(String name, Character value) { return new Impl<Character>(name, EdmSimpleType.STRING, value); }
/** * Creates a new complex-valued OData property of the given edm-type. * * @param name the property name * @param type the property edm-type * @param value the property values * @return a new OData property instance */ public static OProperty<List<OProperty<?>>> complex(String name, EdmComplexType type, List<OProperty<?>> value) { return new Impl<List<OProperty<?>>>(name, type, value); }
/** * Creates a new LocalTime-valued OData property with {@link EdmSimpleType#TIME} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<LocalTime> time(String name, Calendar value) { return new Impl<LocalTime>(name, EdmSimpleType.TIME, value != null ? LocalTime.fromCalendarFields(value) : null); }
/** * Creates a new LocalTime-valued OData property with {@link EdmSimpleType#TIME} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<LocalTime> time(String name, Date value) { return new Impl<LocalTime>(name, EdmSimpleType.TIME, value != null ? LocalTime.fromDateFields(value) : null); }
/** * Creates a new LocalDateTime-valued OData property with {@link EdmSimpleType#DATETIME} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<LocalDateTime> datetime(String name, java.sql.Date value) { return new Impl<LocalDateTime>(name, EdmSimpleType.DATETIME, value != null ? new LocalDateTime(value) : null); }