![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.securityinsights.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;
/**
* Describes the entity mappings of a single entity.
*/
@Fluent
public final class BookmarkEntityMappings implements JsonSerializable {
/*
* The entity type
*/
private String entityType;
/*
* Array of fields mapping for that entity type
*/
private List fieldMappings;
/**
* Creates an instance of BookmarkEntityMappings class.
*/
public BookmarkEntityMappings() {
}
/**
* Get the entityType property: The entity type.
*
* @return the entityType value.
*/
public String entityType() {
return this.entityType;
}
/**
* Set the entityType property: The entity type.
*
* @param entityType the entityType value to set.
* @return the BookmarkEntityMappings object itself.
*/
public BookmarkEntityMappings withEntityType(String entityType) {
this.entityType = entityType;
return this;
}
/**
* Get the fieldMappings property: Array of fields mapping for that entity type.
*
* @return the fieldMappings value.
*/
public List fieldMappings() {
return this.fieldMappings;
}
/**
* Set the fieldMappings property: Array of fields mapping for that entity type.
*
* @param fieldMappings the fieldMappings value to set.
* @return the BookmarkEntityMappings object itself.
*/
public BookmarkEntityMappings withFieldMappings(List fieldMappings) {
this.fieldMappings = fieldMappings;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (fieldMappings() != null) {
fieldMappings().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("entityType", this.entityType);
jsonWriter.writeArrayField("fieldMappings", this.fieldMappings, (writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of BookmarkEntityMappings from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of BookmarkEntityMappings if the JsonReader was pointing to an instance of it, or null if it
* was pointing to JSON null.
* @throws IOException If an error occurs while reading the BookmarkEntityMappings.
*/
public static BookmarkEntityMappings fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
BookmarkEntityMappings deserializedBookmarkEntityMappings = new BookmarkEntityMappings();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("entityType".equals(fieldName)) {
deserializedBookmarkEntityMappings.entityType = reader.getString();
} else if ("fieldMappings".equals(fieldName)) {
List fieldMappings
= reader.readArray(reader1 -> EntityFieldMapping.fromJson(reader1));
deserializedBookmarkEntityMappings.fieldMappings = fieldMappings;
} else {
reader.skipChildren();
}
}
return deserializedBookmarkEntityMappings;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy