com.sportradar.unifiedodds.sdk.caching.CacheItem Maven / Gradle / Ivy
/*
* Copyright (C) Sportradar AG. See LICENSE for full license governing this code
*/
package com.sportradar.unifiedodds.sdk.caching;
import com.sportradar.utils.URN;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* Base interface of cached entities
*/
public interface CacheItem {
/**
* Returns the {@link URN} representing id of the related entity
*
* @return the {@link URN} representing id of the related entity
*/
URN getId();
/**
* Returns the {@link Map} containing translated names of the item
*
* @param locales a {@link List} specifying the required languages
* @return the {@link Map} containing translated names of the item
*/
Map getNames(List locales);
/**
* Determines whether the current instance has translations for the specified languages
*
* @param localeList a {@link List} specifying the required languages
* @return true
if the current instance contains data in the required locals, otherwise false
.
*/
boolean hasTranslationsLoadedFor(List localeList);
default void merge(T endpointData, Locale dataLocale) {}
}