com.google.api.services.safebrowsing.model.ThreatEntry 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-11-07 19:12:12 UTC)
* on 2017-11-29 at 22:37:57 UTC
* Modify at your own risk.
*/
package com.google.api.services.safebrowsing.model;
/**
* An individual threat; for example, a malicious URL or its hash representation. Only one of these
* fields should be set.
*
* 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 ThreatEntry extends com.google.api.client.json.GenericJson {
/**
* The digest of an executable in SHA256 format. The API supports both binary and hex digests. For
* JSON requests, digests are base64-encoded.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String digest;
/**
* A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. This field is in
* binary format. For JSON requests, hashes are base64-encoded.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String hash;
/**
* A URL.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String url;
/**
* The digest of an executable in SHA256 format. The API supports both binary and hex digests. For
* JSON requests, digests are base64-encoded.
* @see #decodeDigest()
* @return value or {@code null} for none
*/
public java.lang.String getDigest() {
return digest;
}
/**
* The digest of an executable in SHA256 format. The API supports both binary and hex digests. For
* JSON requests, digests are base64-encoded.
* @see #getDigest()
* @return Base64 decoded value or {@code null} for none
*
* @since 1.14
*/
public byte[] decodeDigest() {
return com.google.api.client.util.Base64.decodeBase64(digest);
}
/**
* The digest of an executable in SHA256 format. The API supports both binary and hex digests. For
* JSON requests, digests are base64-encoded.
* @see #encodeDigest()
* @param digest digest or {@code null} for none
*/
public ThreatEntry setDigest(java.lang.String digest) {
this.digest = digest;
return this;
}
/**
* The digest of an executable in SHA256 format. The API supports both binary and hex digests. For
* JSON requests, digests are base64-encoded.
* @see #setDigest()
*
*
* The value is encoded Base64 or {@code null} for none.
*
*
* @since 1.14
*/
public ThreatEntry encodeDigest(byte[] digest) {
this.digest = com.google.api.client.util.Base64.encodeBase64URLSafeString(digest);
return this;
}
/**
* A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. This field is in
* binary format. For JSON requests, hashes are base64-encoded.
* @see #decodeHash()
* @return value or {@code null} for none
*/
public java.lang.String getHash() {
return hash;
}
/**
* A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. This field is in
* binary format. For JSON requests, hashes are base64-encoded.
* @see #getHash()
* @return Base64 decoded value or {@code null} for none
*
* @since 1.14
*/
public byte[] decodeHash() {
return com.google.api.client.util.Base64.decodeBase64(hash);
}
/**
* A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. This field is in
* binary format. For JSON requests, hashes are base64-encoded.
* @see #encodeHash()
* @param hash hash or {@code null} for none
*/
public ThreatEntry setHash(java.lang.String hash) {
this.hash = hash;
return this;
}
/**
* A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. This field is in
* binary format. For JSON requests, hashes are base64-encoded.
* @see #setHash()
*
*
* The value is encoded Base64 or {@code null} for none.
*
*
* @since 1.14
*/
public ThreatEntry encodeHash(byte[] hash) {
this.hash = com.google.api.client.util.Base64.encodeBase64URLSafeString(hash);
return this;
}
/**
* A URL.
* @return value or {@code null} for none
*/
public java.lang.String getUrl() {
return url;
}
/**
* A URL.
* @param url url or {@code null} for none
*/
public ThreatEntry setUrl(java.lang.String url) {
this.url = url;
return this;
}
@Override
public ThreatEntry set(String fieldName, Object value) {
return (ThreatEntry) super.set(fieldName, value);
}
@Override
public ThreatEntry clone() {
return (ThreatEntry) super.clone();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy