static Value<?> fromPb(com.google.datastore.v1.Value proto) { ValueTypeCase descriptorId = proto.getValueTypeCase(); ValueType valueType = ValueType.getByDescriptorId(descriptorId.getNumber()); return valueType == null ? RawValue.MARSHALLER.fromProto(proto).build() : valueType.getMarshaller().fromProto(proto).build(); } }
@Before public void setUp() throws Exception { ImmutableMap.Builder<ValueType, Value<?>> builder = ImmutableMap.builder(); for (ValueType valueType : ValueType.values()) { Object[] values = TYPES.get(valueType); @SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") com.google.datastore.v1.Value toPb() { return getType().getMarshaller().toProto(this); }
@SuppressWarnings("unchecked") com.google.datastore.v1.Value toPb() { return getType().getMarshaller().toProto(this); }
static Value<?> fromPb(com.google.datastore.v1.Value proto) { ValueTypeCase descriptorId = proto.getValueTypeCase(); ValueType valueType = ValueType.getByDescriptorId(descriptorId.getNumber()); return valueType == null ? RawValue.MARSHALLER.fromProto(proto).build() : valueType.getMarshaller().fromProto(proto).build(); } }