com.azure.spring.data.cosmos.repository.query.SimpleCosmosEntityMetadata Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-spring-data-cosmos Show documentation
Show all versions of azure-spring-data-cosmos Show documentation
Spring Data for Azure Cosmos DB SQL API
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.spring.data.cosmos.repository.query;
import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation;
import org.springframework.util.Assert;
/**
* Metadata class to describe simple cosmos entity includes domain type and cosmos entity information
*/
public class SimpleCosmosEntityMetadata implements CosmosEntityMetadata {
private final Class type;
private final CosmosEntityInformation entityInformation;
/**
* Initialization
*
* @param type the actual domain class type
* @param entityInformation cosmos entity
*/
public SimpleCosmosEntityMetadata(Class type, CosmosEntityInformation entityInformation) {
Assert.notNull(type, "type must not be null!");
Assert.notNull(entityInformation, "entityInformation must not be null!");
this.type = type;
this.entityInformation = entityInformation;
}
/**
* Return the actual domain class type
*
* @return type
*/
public Class getJavaType() {
return type;
}
/**
* Get collection name of cosmos
*
* @return container name
*/
public String getCollectionName() {
return entityInformation.getContainerName();
}
/**
* Get container name of cosmos
*
* @return container name
*/
public String getContainerName() {
return entityInformation.getContainerName();
}
}