com.amazonaws.services.macie2.model.Record Maven / Gradle / Ivy
Show all versions of aws-java-sdk-macie2 Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
package com.amazonaws.services.macie2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Specifies the location of an occurrence of sensitive data in an Apache Avro object container, Apache Parquet file,
* JSON file, or JSON Lines file.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Record implements Serializable, Cloneable, StructuredPojo {
/**
*
* The path, as a JSONPath expression, to the sensitive data. For an Avro object container or Parquet file, this is
* the path to the field in the record (recordIndex) that contains the data. For a JSON or JSON Lines file, this is
* the path to the field or array that contains the data. If the data is a value in an array, the path also
* indicates which value contains the data.
*
*
* If Amazon Macie detects sensitive data in the name of any element in the path, Macie omits this field. If the
* name of an element exceeds 240 characters, Macie truncates the name by removing characters from the beginning of
* the name. If the resulting full path exceeds 250 characters, Macie also truncates the path, starting with the
* first element in the path, until the path contains 250 or fewer characters.
*
*/
private String jsonPath;
/**
*
* For an Avro object container or Parquet file, the record index, starting from 0, for the record that contains the
* sensitive data. For a JSON Lines file, the line index, starting from 0, for the line that contains the sensitive
* data. This value is always 0 for JSON files.
*
*/
private Long recordIndex;
/**
*
* The path, as a JSONPath expression, to the sensitive data. For an Avro object container or Parquet file, this is
* the path to the field in the record (recordIndex) that contains the data. For a JSON or JSON Lines file, this is
* the path to the field or array that contains the data. If the data is a value in an array, the path also
* indicates which value contains the data.
*
*
* If Amazon Macie detects sensitive data in the name of any element in the path, Macie omits this field. If the
* name of an element exceeds 240 characters, Macie truncates the name by removing characters from the beginning of
* the name. If the resulting full path exceeds 250 characters, Macie also truncates the path, starting with the
* first element in the path, until the path contains 250 or fewer characters.
*
*
* @param jsonPath
* The path, as a JSONPath expression, to the sensitive data. For an Avro object container or Parquet file,
* this is the path to the field in the record (recordIndex) that contains the data. For a JSON or JSON Lines
* file, this is the path to the field or array that contains the data. If the data is a value in an array,
* the path also indicates which value contains the data.
*
* If Amazon Macie detects sensitive data in the name of any element in the path, Macie omits this field. If
* the name of an element exceeds 240 characters, Macie truncates the name by removing characters from the
* beginning of the name. If the resulting full path exceeds 250 characters, Macie also truncates the path,
* starting with the first element in the path, until the path contains 250 or fewer characters.
*/
public void setJsonPath(String jsonPath) {
this.jsonPath = jsonPath;
}
/**
*
* The path, as a JSONPath expression, to the sensitive data. For an Avro object container or Parquet file, this is
* the path to the field in the record (recordIndex) that contains the data. For a JSON or JSON Lines file, this is
* the path to the field or array that contains the data. If the data is a value in an array, the path also
* indicates which value contains the data.
*
*
* If Amazon Macie detects sensitive data in the name of any element in the path, Macie omits this field. If the
* name of an element exceeds 240 characters, Macie truncates the name by removing characters from the beginning of
* the name. If the resulting full path exceeds 250 characters, Macie also truncates the path, starting with the
* first element in the path, until the path contains 250 or fewer characters.
*
*
* @return The path, as a JSONPath expression, to the sensitive data. For an Avro object container or Parquet file,
* this is the path to the field in the record (recordIndex) that contains the data. For a JSON or JSON
* Lines file, this is the path to the field or array that contains the data. If the data is a value in an
* array, the path also indicates which value contains the data.
*
* If Amazon Macie detects sensitive data in the name of any element in the path, Macie omits this field. If
* the name of an element exceeds 240 characters, Macie truncates the name by removing characters from the
* beginning of the name. If the resulting full path exceeds 250 characters, Macie also truncates the path,
* starting with the first element in the path, until the path contains 250 or fewer characters.
*/
public String getJsonPath() {
return this.jsonPath;
}
/**
*
* The path, as a JSONPath expression, to the sensitive data. For an Avro object container or Parquet file, this is
* the path to the field in the record (recordIndex) that contains the data. For a JSON or JSON Lines file, this is
* the path to the field or array that contains the data. If the data is a value in an array, the path also
* indicates which value contains the data.
*
*
* If Amazon Macie detects sensitive data in the name of any element in the path, Macie omits this field. If the
* name of an element exceeds 240 characters, Macie truncates the name by removing characters from the beginning of
* the name. If the resulting full path exceeds 250 characters, Macie also truncates the path, starting with the
* first element in the path, until the path contains 250 or fewer characters.
*
*
* @param jsonPath
* The path, as a JSONPath expression, to the sensitive data. For an Avro object container or Parquet file,
* this is the path to the field in the record (recordIndex) that contains the data. For a JSON or JSON Lines
* file, this is the path to the field or array that contains the data. If the data is a value in an array,
* the path also indicates which value contains the data.
*
* If Amazon Macie detects sensitive data in the name of any element in the path, Macie omits this field. If
* the name of an element exceeds 240 characters, Macie truncates the name by removing characters from the
* beginning of the name. If the resulting full path exceeds 250 characters, Macie also truncates the path,
* starting with the first element in the path, until the path contains 250 or fewer characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Record withJsonPath(String jsonPath) {
setJsonPath(jsonPath);
return this;
}
/**
*
* For an Avro object container or Parquet file, the record index, starting from 0, for the record that contains the
* sensitive data. For a JSON Lines file, the line index, starting from 0, for the line that contains the sensitive
* data. This value is always 0 for JSON files.
*
*
* @param recordIndex
* For an Avro object container or Parquet file, the record index, starting from 0, for the record that
* contains the sensitive data. For a JSON Lines file, the line index, starting from 0, for the line that
* contains the sensitive data. This value is always 0 for JSON files.
*/
public void setRecordIndex(Long recordIndex) {
this.recordIndex = recordIndex;
}
/**
*
* For an Avro object container or Parquet file, the record index, starting from 0, for the record that contains the
* sensitive data. For a JSON Lines file, the line index, starting from 0, for the line that contains the sensitive
* data. This value is always 0 for JSON files.
*
*
* @return For an Avro object container or Parquet file, the record index, starting from 0, for the record that
* contains the sensitive data. For a JSON Lines file, the line index, starting from 0, for the line that
* contains the sensitive data. This value is always 0 for JSON files.
*/
public Long getRecordIndex() {
return this.recordIndex;
}
/**
*
* For an Avro object container or Parquet file, the record index, starting from 0, for the record that contains the
* sensitive data. For a JSON Lines file, the line index, starting from 0, for the line that contains the sensitive
* data. This value is always 0 for JSON files.
*
*
* @param recordIndex
* For an Avro object container or Parquet file, the record index, starting from 0, for the record that
* contains the sensitive data. For a JSON Lines file, the line index, starting from 0, for the line that
* contains the sensitive data. This value is always 0 for JSON files.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Record withRecordIndex(Long recordIndex) {
setRecordIndex(recordIndex);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getJsonPath() != null)
sb.append("JsonPath: ").append(getJsonPath()).append(",");
if (getRecordIndex() != null)
sb.append("RecordIndex: ").append(getRecordIndex());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Record == false)
return false;
Record other = (Record) obj;
if (other.getJsonPath() == null ^ this.getJsonPath() == null)
return false;
if (other.getJsonPath() != null && other.getJsonPath().equals(this.getJsonPath()) == false)
return false;
if (other.getRecordIndex() == null ^ this.getRecordIndex() == null)
return false;
if (other.getRecordIndex() != null && other.getRecordIndex().equals(this.getRecordIndex()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getJsonPath() == null) ? 0 : getJsonPath().hashCode());
hashCode = prime * hashCode + ((getRecordIndex() == null) ? 0 : getRecordIndex().hashCode());
return hashCode;
}
@Override
public Record clone() {
try {
return (Record) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.macie2.model.transform.RecordMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}