/** * Make a timestamp value given a date. */ public static Value.Builder makeValue(Date date) { return Value.newBuilder().setTimestampValue(toTimestamp(date.getTime() * 1000L)); }
/** * Make a timestamp value given a date. */ public static Value.Builder makeValue(Date date) { return Value.newBuilder().setTimestampValue(toTimestamp(date.getTime() * 1000L)); }
this.value.setBooleanValue((Boolean) value); } else if (value instanceof Date) { this.value.setTimestampValue(toTimestamp((Date) value)); } else if (value instanceof ByteString) { this.value.setBlobValue((ByteString) value);
v = Value.newBuilder().setTimestampValue(timestamp) .setExcludeFromIndexes(isExcluded).build(); Instant instant = parseTimestamp((String) value); Timestamp timestamp = toTimestamp(instant); v = Value.newBuilder().setTimestampValue(timestamp) .setExcludeFromIndexes(isExcluded).build(); v = Value.newBuilder().setTimestampValue(timestamp) .setExcludeFromIndexes(isExcluded).build(); } else if (value instanceof String && parseDate((String) value) != null) { Instant instant = parseDate((String) value); Timestamp timestamp = toTimestamp(instant); v = Value.newBuilder().setTimestampValue(timestamp) .setExcludeFromIndexes(isExcluded).build();
valueBuilder.setTimestampValue(Timestamps.fromMillis(timeInMillis)); break; case "DATE":
/** * Create a new value containing a date. * * @param value The date to build a value from. * @return A new value builder. */ public static Value.Builder from(final Date value) { return new Value.Builder(com.google.datastore.v1.Value.newBuilder().setTimestampValue(toTimestamp(value))); }
@Override protected void setValue(TimestampValue from, com.google.datastore.v1.Value.Builder to) { to.setTimestampValue(from.get().toProto()); } };
@Override protected void setValue(TimestampValue from, com.google.datastore.v1.Value.Builder to) { to.setTimestampValue(from.get().toProto()); } };