com.google.api.services.datastore.model.Value Maven / Gradle / Ivy
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://code.google.com/p/google-apis-client-generator/
* (build: 2016-04-08 17:16:44 UTC)
* on 2016-04-27 at 02:41:28 UTC
* Modify at your own risk.
*/
package com.google.api.services.datastore.model;
/**
* A message that can hold any of the supported value types and associated metadata.
*
* This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Google Cloud Datastore API. For a detailed
* explanation see:
* http://code.google.com/p/google-http-java-client/wiki/JSON
*
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class Value extends com.google.api.client.json.GenericJson {
/**
* A blob key value.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String blobKeyValue;
/**
* A blob value. May be a maximum of 1,000,000 bytes. When indexed is true, may have at most 500
* bytes.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String blobValue;
/**
* A boolean value.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean booleanValue;
/**
* A timestamp value.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private com.google.api.client.util.DateTime dateTimeValue;
/**
* A double value.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Double doubleValue;
/**
* An entity value. May have no key. May have a key with an incomplete key path. May have a
* reserved/read-only key.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private Entity entityValue;
/**
* If the value should be indexed.
*
* The indexed property may be set for a null value. When indexed is true, stringValue is limited
* to 500 characters and the blob value is limited to 500 bytes. Input values by default have
* indexed set to true; however, you can explicitly set indexed to true if you want. (An output
* value never has indexed explicitly set to true.) If a value is itself an entity, it cannot have
* indexed set to true.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean indexed;
/**
* An integer value.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key @com.google.api.client.json.JsonString
private java.lang.Long integerValue;
/**
* A key value.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private Key keyValue;
/**
* The meaning field is reserved and should not be used.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer meaning;
/**
* A UTF-8 encoded string value. When indexed is true, may have at most 500 characters.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String stringValue;
/**
* A blob key value.
* @return value or {@code null} for none
*/
public java.lang.String getBlobKeyValue() {
return blobKeyValue;
}
/**
* A blob key value.
* @param blobKeyValue blobKeyValue or {@code null} for none
*/
public Value setBlobKeyValue(java.lang.String blobKeyValue) {
this.blobKeyValue = blobKeyValue;
return this;
}
/**
* A blob value. May be a maximum of 1,000,000 bytes. When indexed is true, may have at most 500
* bytes.
* @see #decodeBlobValue()
* @return value or {@code null} for none
*/
public java.lang.String getBlobValue() {
return blobValue;
}
/**
* A blob value. May be a maximum of 1,000,000 bytes. When indexed is true, may have at most 500
* bytes.
* @see #getBlobValue()
* @return Base64 decoded value or {@code null} for none
*
* @since 1.14
*/
public byte[] decodeBlobValue() {
return com.google.api.client.util.Base64.decodeBase64(blobValue);
}
/**
* A blob value. May be a maximum of 1,000,000 bytes. When indexed is true, may have at most 500
* bytes.
* @see #encodeBlobValue()
* @param blobValue blobValue or {@code null} for none
*/
public Value setBlobValue(java.lang.String blobValue) {
this.blobValue = blobValue;
return this;
}
/**
* A blob value. May be a maximum of 1,000,000 bytes. When indexed is true, may have at most 500
* bytes.
* @see #setBlobValue()
*
*
* The value is encoded Base64 or {@code null} for none.
*
*
* @since 1.14
*/
public Value encodeBlobValue(byte[] blobValue) {
this.blobValue = com.google.api.client.util.Base64.encodeBase64URLSafeString(blobValue);
return this;
}
/**
* A boolean value.
* @return value or {@code null} for none
*/
public java.lang.Boolean getBooleanValue() {
return booleanValue;
}
/**
* A boolean value.
* @param booleanValue booleanValue or {@code null} for none
*/
public Value setBooleanValue(java.lang.Boolean booleanValue) {
this.booleanValue = booleanValue;
return this;
}
/**
* A timestamp value.
* @return value or {@code null} for none
*/
public com.google.api.client.util.DateTime getDateTimeValue() {
return dateTimeValue;
}
/**
* A timestamp value.
* @param dateTimeValue dateTimeValue or {@code null} for none
*/
public Value setDateTimeValue(com.google.api.client.util.DateTime dateTimeValue) {
this.dateTimeValue = dateTimeValue;
return this;
}
/**
* A double value.
* @return value or {@code null} for none
*/
public java.lang.Double getDoubleValue() {
return doubleValue;
}
/**
* A double value.
* @param doubleValue doubleValue or {@code null} for none
*/
public Value setDoubleValue(java.lang.Double doubleValue) {
this.doubleValue = doubleValue;
return this;
}
/**
* An entity value. May have no key. May have a key with an incomplete key path. May have a
* reserved/read-only key.
* @return value or {@code null} for none
*/
public Entity getEntityValue() {
return entityValue;
}
/**
* An entity value. May have no key. May have a key with an incomplete key path. May have a
* reserved/read-only key.
* @param entityValue entityValue or {@code null} for none
*/
public Value setEntityValue(Entity entityValue) {
this.entityValue = entityValue;
return this;
}
/**
* If the value should be indexed.
*
* The indexed property may be set for a null value. When indexed is true, stringValue is limited
* to 500 characters and the blob value is limited to 500 bytes. Input values by default have
* indexed set to true; however, you can explicitly set indexed to true if you want. (An output
* value never has indexed explicitly set to true.) If a value is itself an entity, it cannot have
* indexed set to true.
* @return value or {@code null} for none
*/
public java.lang.Boolean getIndexed() {
return indexed;
}
/**
* If the value should be indexed.
*
* The indexed property may be set for a null value. When indexed is true, stringValue is limited
* to 500 characters and the blob value is limited to 500 bytes. Input values by default have
* indexed set to true; however, you can explicitly set indexed to true if you want. (An output
* value never has indexed explicitly set to true.) If a value is itself an entity, it cannot have
* indexed set to true.
* @param indexed indexed or {@code null} for none
*/
public Value setIndexed(java.lang.Boolean indexed) {
this.indexed = indexed;
return this;
}
/**
* An integer value.
* @return value or {@code null} for none
*/
public java.lang.Long getIntegerValue() {
return integerValue;
}
/**
* An integer value.
* @param integerValue integerValue or {@code null} for none
*/
public Value setIntegerValue(java.lang.Long integerValue) {
this.integerValue = integerValue;
return this;
}
/**
* A key value.
* @return value or {@code null} for none
*/
public Key getKeyValue() {
return keyValue;
}
/**
* A key value.
* @param keyValue keyValue or {@code null} for none
*/
public Value setKeyValue(Key keyValue) {
this.keyValue = keyValue;
return this;
}
/**
* The meaning field is reserved and should not be used.
* @return value or {@code null} for none
*/
public java.lang.Integer getMeaning() {
return meaning;
}
/**
* The meaning field is reserved and should not be used.
* @param meaning meaning or {@code null} for none
*/
public Value setMeaning(java.lang.Integer meaning) {
this.meaning = meaning;
return this;
}
/**
* A UTF-8 encoded string value. When indexed is true, may have at most 500 characters.
* @return value or {@code null} for none
*/
public java.lang.String getStringValue() {
return stringValue;
}
/**
* A UTF-8 encoded string value. When indexed is true, may have at most 500 characters.
* @param stringValue stringValue or {@code null} for none
*/
public Value setStringValue(java.lang.String stringValue) {
this.stringValue = stringValue;
return this;
}
@Override
public Value set(String fieldName, Object value) {
return (Value) super.set(fieldName, value);
}
@Override
public Value clone() {
return (Value) super.clone();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy