public final class SdkHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ApiResponseErrorPattern
The regex pattern to extract error message from failed API requests
|
static String |
ApiResponseMessagePattern
The regex pattern to extract response message from failed API requests
|
static org.slf4j.Logger |
ExecutionLog |
static String |
InVariantMarketListCache |
static String |
ISO_8601_24H_FORMAT |
static String |
ISO_8601_24H_FULL_FORMAT |
static int |
MarketDescriptionMinFetchInterval |
static String |
VariantMarketListCache |
static String |
VariantMarketSingleCache |
Constructor and Description |
---|
SdkHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkCauseReason(Throwable cause,
String message) |
static Locale |
checkConfigurationLocales(Locale defaultLocale,
Set<Locale> supportedLocales) |
static Date |
combineDateAndTime(Date date,
Date time) |
static String |
dateToString(Date date) |
static String |
dictionaryToString(Map<String,String> dict) |
static String |
doubleToStringWithSign(double value) |
static String |
extractHttpResponseMessage(String responseContent) |
static Map<Locale,String> |
filterLocales(Map<Locale,String> data,
List<Locale> filterLocales)
Filters out the translated data not needed
|
static List<Locale> |
findMissingLocales(Collection<Locale> have,
List<Locale> want)
Calculates and returns the missing locales within the provided
List |
static String |
getAbbreviationFromName(String input,
int length)
Get the abbreviation from the input string
|
static long |
getTimeDifferenceInSeconds(Date d1,
Date d2) |
static String |
getUuid(int size)
Get the specified size of UUID
|
static String |
getVersion() |
static String |
integerSetToString(Set<Integer> set) |
static boolean |
isDataNotFound(Throwable e) |
static boolean |
isDataNotFound(Throwable e,
int counter) |
static String |
localeListToString(List<Locale> locales) |
static String |
obfuscate(String input)
Obfuscate the input string
|
static Map<Urn,ReferenceIdCi> |
parseCompetitorsReferences(List<com.sportradar.uf.sportsapi.datamodel.SapiTeam> competitors,
Map<Urn,ReferenceIdCi> currentCompetitorsReferences)
Get competitor reference from a list of competitors
Note: reference must be checked and updated, since it is not sure that references on summary are the same as on fixture
|
static Map<Urn,ReferenceIdCi> |
parseTeamCompetitorsReferences(List<com.sportradar.uf.sportsapi.datamodel.SapiTeamCompetitor> competitors,
Map<Urn,ReferenceIdCi> currentCompetitorsReferences)
Get competitor reference from a list of competitors
Note: reference must be checked and updated, since it is not sure that references on summary are the same as on fixture
|
static String |
specifierKeyListToString(List<Specifier> specifiers) |
static String |
specifierListToString(List<Specifier> specifiers) |
static boolean |
stringIsNullOrEmpty(String input)
Check is string is null or empty
|
static String |
stringSetToString(Set<String> set) |
static Date |
toDate(String dateString) |
static Date |
toDate(XMLGregorianCalendar gregorianCalendar) |
public static final org.slf4j.Logger ExecutionLog
public static int MarketDescriptionMinFetchInterval
public static String InVariantMarketListCache
public static String VariantMarketSingleCache
public static String VariantMarketListCache
public static final String ISO_8601_24H_FORMAT
public static final String ISO_8601_24H_FULL_FORMAT
public static final String ApiResponseErrorPattern
public static final String ApiResponseMessagePattern
public static List<Locale> findMissingLocales(Collection<Locale> have, List<Locale> want)
List
public static Map<Locale,String> filterLocales(Map<Locale,String> data, List<Locale> filterLocales)
data
- the data to be filteredfilterLocales
- the requested localespublic static String getAbbreviationFromName(String input, int length)
input
- input text to be abbreviatedlength
- of the abbreviationpublic static Map<Urn,ReferenceIdCi> parseCompetitorsReferences(List<com.sportradar.uf.sportsapi.datamodel.SapiTeam> competitors, Map<Urn,ReferenceIdCi> currentCompetitorsReferences)
competitors
- competitor id with which is associated referencecurrentCompetitorsReferences
- competitor referencespublic static Map<Urn,ReferenceIdCi> parseTeamCompetitorsReferences(List<com.sportradar.uf.sportsapi.datamodel.SapiTeamCompetitor> competitors, Map<Urn,ReferenceIdCi> currentCompetitorsReferences)
competitors
- competitor id with which is associated referencecurrentCompetitorsReferences
- competitor referencespublic static Locale checkConfigurationLocales(Locale defaultLocale, Set<Locale> supportedLocales)
public static Date toDate(XMLGregorianCalendar gregorianCalendar)
public static Date toDate(String dateString) throws ParseException
ParseException
public static String doubleToStringWithSign(double value)
public static boolean isDataNotFound(Throwable e)
public static boolean isDataNotFound(Throwable e, int counter)
public static boolean stringIsNullOrEmpty(String input)
input
- to be checkedpublic static String obfuscate(String input)
input
- text to be obfuscatedpublic static String getUuid(int size)
size
- the substring sizepublic static String getVersion()
Copyright © 2016–2025. All rights reserved.