com.google.api.services.safebrowsing.model.RiceDeltaEncoding 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://github.com/google/apis-client-generator/
* (build: 2017-02-15 17:18:02 UTC)
* on 2017-03-16 at 20:23:10 UTC
* Modify at your own risk.
*/
package com.google.api.services.safebrowsing.model;
/**
* The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or compressed removal
* indices.
*
* 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 Safe Browsing API. For a detailed explanation
* see:
* https://developers.google.com/api-client-library/java/google-http-java-client/json
*
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class RiceDeltaEncoding extends com.google.api.client.json.GenericJson {
/**
* The encoded deltas that are encoded using the Golomb-Rice coder.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String encodedData;
/**
* The offset of the first entry in the encoded data, or, if only a single integer was encoded,
* that single integer's value.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key @com.google.api.client.json.JsonString
private java.lang.Long firstValue;
/**
* The number of entries that are delta encoded in the encoded data. If only a single integer was
* encoded, this will be zero and the single value will be stored in `first_value`.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer numEntries;
/**
* The Golomb-Rice parameter, which is a number between 2 and 28. This field is missing (that is,
* zero) if `num_entries` is zero.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer riceParameter;
/**
* The encoded deltas that are encoded using the Golomb-Rice coder.
* @see #decodeEncodedData()
* @return value or {@code null} for none
*/
public java.lang.String getEncodedData() {
return encodedData;
}
/**
* The encoded deltas that are encoded using the Golomb-Rice coder.
* @see #getEncodedData()
* @return Base64 decoded value or {@code null} for none
*
* @since 1.14
*/
public byte[] decodeEncodedData() {
return com.google.api.client.util.Base64.decodeBase64(encodedData);
}
/**
* The encoded deltas that are encoded using the Golomb-Rice coder.
* @see #encodeEncodedData()
* @param encodedData encodedData or {@code null} for none
*/
public RiceDeltaEncoding setEncodedData(java.lang.String encodedData) {
this.encodedData = encodedData;
return this;
}
/**
* The encoded deltas that are encoded using the Golomb-Rice coder.
* @see #setEncodedData()
*
*
* The value is encoded Base64 or {@code null} for none.
*
*
* @since 1.14
*/
public RiceDeltaEncoding encodeEncodedData(byte[] encodedData) {
this.encodedData = com.google.api.client.util.Base64.encodeBase64URLSafeString(encodedData);
return this;
}
/**
* The offset of the first entry in the encoded data, or, if only a single integer was encoded,
* that single integer's value.
* @return value or {@code null} for none
*/
public java.lang.Long getFirstValue() {
return firstValue;
}
/**
* The offset of the first entry in the encoded data, or, if only a single integer was encoded,
* that single integer's value.
* @param firstValue firstValue or {@code null} for none
*/
public RiceDeltaEncoding setFirstValue(java.lang.Long firstValue) {
this.firstValue = firstValue;
return this;
}
/**
* The number of entries that are delta encoded in the encoded data. If only a single integer was
* encoded, this will be zero and the single value will be stored in `first_value`.
* @return value or {@code null} for none
*/
public java.lang.Integer getNumEntries() {
return numEntries;
}
/**
* The number of entries that are delta encoded in the encoded data. If only a single integer was
* encoded, this will be zero and the single value will be stored in `first_value`.
* @param numEntries numEntries or {@code null} for none
*/
public RiceDeltaEncoding setNumEntries(java.lang.Integer numEntries) {
this.numEntries = numEntries;
return this;
}
/**
* The Golomb-Rice parameter, which is a number between 2 and 28. This field is missing (that is,
* zero) if `num_entries` is zero.
* @return value or {@code null} for none
*/
public java.lang.Integer getRiceParameter() {
return riceParameter;
}
/**
* The Golomb-Rice parameter, which is a number between 2 and 28. This field is missing (that is,
* zero) if `num_entries` is zero.
* @param riceParameter riceParameter or {@code null} for none
*/
public RiceDeltaEncoding setRiceParameter(java.lang.Integer riceParameter) {
this.riceParameter = riceParameter;
return this;
}
@Override
public RiceDeltaEncoding set(String fieldName, Object value) {
return (RiceDeltaEncoding) super.set(fieldName, value);
}
@Override
public RiceDeltaEncoding clone() {
return (RiceDeltaEncoding) super.clone();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy