本文整理了Java中com.google.cloud.datastore.KeyValue
类的一些代码示例,展示了KeyValue
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyValue
类的具体详情如下:
包路径:com.google.cloud.datastore.KeyValue
类名称:KeyValue
暂无
代码示例来源:origin: googleapis/google-cloud-java
/** Adds the provided {@code Key} values to the {@code ListValue} builder. */
public Builder addValue(Key first, Key... other) {
listBuilder.add(KeyValue.of(first));
for (Key value : other) {
listBuilder.add(KeyValue.of(value));
}
return this;
}
代码示例来源:origin: googleapis/google-cloud-java
@SuppressWarnings("deprecation")
@Test
public void testOf() throws Exception {
KeyValue value = KeyValue.of(CONTENT);
assertEquals(CONTENT, value.get());
assertFalse(value.excludeFromIndexes());
}
代码示例来源:origin: googleapis/google-cloud-java
@Override
public Builder newBuilder(Key key) {
return KeyValue.newBuilder(key);
}
代码示例来源:origin: googleapis/google-cloud-java
@SuppressWarnings("deprecation")
@Test
public void testBuilder() throws Exception {
KeyValue.Builder builder = KeyValue.newBuilder(CONTENT);
KeyValue value = builder.setMeaning(1).setExcludeFromIndexes(true).build();
assertEquals(CONTENT, value.get());
assertEquals(1, value.getMeaning());
assertTrue(value.excludeFromIndexes());
}
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testToBuilder() throws Exception {
KeyValue value = KeyValue.of(CONTENT);
assertEquals(value, value.toBuilder().build());
}
代码示例来源:origin: googleapis/google-cloud-java
@Override
protected void setValue(KeyValue from, com.google.datastore.v1.Value.Builder to) {
to.setKeyValue(from.get().toPb());
}
};
代码示例来源:origin: googleapis/google-cloud-java
@Override
public KeyValue build() {
return new KeyValue(this);
}
}
代码示例来源:origin: sai-pullabhotla/catatumbo
@Override
public Object toModel(Value<?> input) {
if (input instanceof NullValue) {
return null;
}
KeyValue keyValue = (KeyValue) input;
return new DefaultDatastoreKey(keyValue.get());
}
代码示例来源:origin: googleapis/google-cloud-java
public static KeyValue of(Key key) {
return new KeyValue(key);
}
代码示例来源:origin: googleapis/google-cloud-java
/**
* Sets a property of type {@link KeyValue}.
*
* @param name name of the property
* @param value value associated with the property
*/
public B set(String name, Key value) {
properties.put(name, of(value));
return self();
}
代码示例来源:origin: googleapis/google-cloud-java
public KeyValue(Key key) {
this(newBuilder(key));
}
代码示例来源:origin: com.google.cloud/google-cloud-datastore
@Override
protected void setValue(KeyValue from, com.google.datastore.v1.Value.Builder to) {
to.setKeyValue(from.get().toPb());
}
};
代码示例来源:origin: com.google.cloud/google-cloud-datastore
@Override
public KeyValue build() {
return new KeyValue(this);
}
}
代码示例来源:origin: googleapis/google-cloud-java
public static PropertyFilter ge(String property, Key value) {
return new PropertyFilter(property, Operator.GREATER_THAN_OR_EQUAL, of(value));
}
代码示例来源:origin: com.google.cloud/google-cloud-datastore
@Override
public Builder newBuilder(Key key) {
return KeyValue.newBuilder(key);
}
代码示例来源:origin: sai-pullabhotla/catatumbo
javaValue = input.get();
} else if (input instanceof KeyValue) {
javaValue = new DefaultDatastoreKey(((KeyValue) input).get());
} else if (input instanceof LatLngValue) {
LatLng latLong = ((LatLngValue) input).get();
代码示例来源:origin: com.google.cloud/google-cloud-datastore
public static KeyValue of(Key key) {
return new KeyValue(key);
}
代码示例来源:origin: googleapis/google-cloud-java
/**
* Sets a list property containing elements of type {@link KeyValue}.
*
* @param name name of the property
* @param first the first {@link Key} in the list
* @param second the second {@link Key} in the list
* @param others other {@link Key}s in the list
*/
public B set(String name, Key first, Key second, Key... others) {
List<KeyValue> values = new LinkedList<>();
values.add(of(first));
values.add(of(second));
for (Key other : others) {
values.add(of(other));
}
properties.put(name, of(values));
return self();
}
代码示例来源:origin: com.google.cloud/google-cloud-datastore
public KeyValue(Key key) {
this(newBuilder(key));
}
代码示例来源:origin: googleapis/google-cloud-java
public static PropertyFilter lt(String property, Key value) {
return new PropertyFilter(property, Operator.LESS_THAN, of(value));
}
内容来源于网络,如有侵权,请联系作者删除!