Class SportEntityFactoryImpl
java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.SportEntityFactoryImpl
- All Implemented Interfaces:
SportEntityFactory
A factory used to construct
Competition and Tournament instances-
Constructor Summary
ConstructorsConstructorDescriptionSportEntityFactoryImpl(SportsDataCache sportsDataCache, SportEventCache sportEventCache, ProfileCache profileCache, SportEventStatusFactory sportEventStatusFactory, MappingTypeProvider mappingTypeProvider, SdkInternalConfiguration oddsFeedConfiguration) Initializes a new instance of theSportEntityFactoryImpl -
Method Summary
Modifier and TypeMethodDescriptionbuildCategory(Urn id, List<Locale> locales) Builds the associated category summarybuildCompetitor(Urn id, String qualifier, Integer division, Boolean isVirtual, SportEventCi parentSportEventCi, List<Locale> locales) Builds aCompetitorinstance associated with the providedUrnbuildCompetitorPlayerProfile(Urn id, List<Locale> locales, List<Urn> possibleAssociatedCompetitorIds, Map<Urn, Integer> associatedJerseyNumbers) buildSport(Urn sportId, List<Locale> locales) Builds aSportinstance with the provided databuildSportEvent(Urn id, Urn sportId, List<Locale> locales, boolean buildBasicEventImpl) Builds theSportEventderived class based on the provided databuildSportEvent(Urn id, List<Locale> locales, boolean buildBasicEventImpl) Builds theCompetitionderived class based on the provided databuildSportEvents(List<Urn> ids, List<Locale> locales) Builds a list ofCompetitionderived classes based on the provided databuildSportForCategory(Urn categoryId, List<Locale> locales) Builds the associated category sport summarybuildSports(List<Locale> locales) buildStreamCompetitors(List<Urn> competitorIds, SportEventCi parentSportEventCi, List<Locale> locales) Builds aListofCompetitorinstances Notice: aStreamWrapperExceptionis thrown if any problems are encountered
-
Constructor Details
-
SportEntityFactoryImpl
@Inject public SportEntityFactoryImpl(SportsDataCache sportsDataCache, SportEventCache sportEventCache, ProfileCache profileCache, SportEventStatusFactory sportEventStatusFactory, MappingTypeProvider mappingTypeProvider, SdkInternalConfiguration oddsFeedConfiguration) Initializes a new instance of theSportEntityFactoryImpl- Parameters:
sportsDataCache- aSportsDataCacheinstance used to retrieve sport related infosportEventCache- aSportEventCacheinstance used to retrieve sport eventsprofileCache- aProfileCacheinstance used to retrieve player/competitor profilessportEventStatusFactory- aSportEventStatusFactoryinstance used to build sport event status entitiesmappingTypeProvider- aMappingTypeProviderinstance used to identify proper entity mapping typesoddsFeedConfiguration- the associated feed configuration
-
-
Method Details
-
buildSports
- Specified by:
buildSportsin interfaceSportEntityFactory- Parameters:
locales- - aListof locales specifying the languages used in the returned instances- Returns:
- - a
Listwith the constructedSportinstances - Throws:
ObjectNotFoundException- if the sports list failed to build with the selectedLocales
-
buildSport
Builds aSportinstance with the provided data- Specified by:
buildSportin interfaceSportEntityFactory- Parameters:
sportId- - theUrnsport identifierlocales- - aListof locales specifying the languages used in the returned instance- Returns:
- - the constructed
Sportinstance - Throws:
ObjectNotFoundException- if the requested sport failed to build or was not found
-
buildCategory
Builds the associated category summary- Specified by:
buildCategoryin interfaceSportEntityFactory- Parameters:
id- the identifier of the categorylocales- locales in which the data is provided- Returns:
- a
CategorySummaryassociated with the current instance - Throws:
ObjectNotFoundException- if the category CI could not be found
-
buildSportForCategory
public SportSummary buildSportForCategory(Urn categoryId, List<Locale> locales) throws ObjectNotFoundException Builds the associated category sport summary- Specified by:
buildSportForCategoryin interfaceSportEntityFactory- Parameters:
categoryId- the identifier of the categorylocales- locales in which the data is provided- Returns:
- a
SportSummaryassociated with the current instance - Throws:
ObjectNotFoundException- if the category CI could not be found
-
buildSportEvent
public SportEvent buildSportEvent(Urn id, List<Locale> locales, boolean buildBasicEventImpl) throws ObjectNotFoundException Builds theCompetitionderived class based on the provided data- Specified by:
buildSportEventin interfaceSportEntityFactory- Parameters:
id- - theUrnspecifying the identifier of the sport eventlocales- - aListof locales specifying the languages used in the returned instancebuildBasicEventImpl- - an indication if the basic event entity should be built if the mapping type is unknown- Returns:
- - the constructed object which is derived from the
Competition - Throws:
ObjectNotFoundException- if the requested sport event object could not be provided(failure built, api request errors,..)
-
buildSportEvent
public SportEvent buildSportEvent(Urn id, Urn sportId, List<Locale> locales, boolean buildBasicEventImpl) throws ObjectNotFoundException Builds theSportEventderived class based on the provided data- Specified by:
buildSportEventin interfaceSportEntityFactory- Parameters:
id- - theUrnspecifying the identifier of the sport eventsportId- - theUrnspecifying the sport type of the eventlocales- - aListof locales specifying the languages used in the returned instancebuildBasicEventImpl- - an indication if the basic event entity should be built if the mapping type is unknown- Returns:
- - the constructed object
- Throws:
ObjectNotFoundException- if the requested sport event object could not be provided(failure built, api request errors,..)
-
buildSportEvents
public List<Competition> buildSportEvents(List<Urn> ids, List<Locale> locales) throws ObjectNotFoundException Builds a list ofCompetitionderived classes based on the provided data- Specified by:
buildSportEventsin interfaceSportEntityFactory- Parameters:
ids- - the list ofUrnspecifying the identifier of the sport events to be builtlocales- - aListof locales specifying the languages used in the returned instance- Returns:
- - the constructed objects
- Throws:
ObjectNotFoundException- if the requested sport event objects could not be provided(failure built, api request errors,..)
-
buildCompetitor
public Competitor buildCompetitor(Urn id, String qualifier, Integer division, Boolean isVirtual, SportEventCi parentSportEventCi, List<Locale> locales) throws ObjectNotFoundException Builds aCompetitorinstance associated with the providedUrn- Specified by:
buildCompetitorin interfaceSportEntityFactory- Parameters:
id- the competitor identifierqualifier- the competitor qualifier (if available)division- the competitor division (if available)isVirtual-parentSportEventCi- the parentSportEventCithisCompetitorbelongs tolocales- theLocales in which the data should be available- Returns:
- the constructed object
- Throws:
ObjectNotFoundException- if the requested instance could not be provided
-
buildStreamCompetitors
public List<Competitor> buildStreamCompetitors(List<Urn> competitorIds, SportEventCi parentSportEventCi, List<Locale> locales) Builds aListofCompetitorinstances Notice: aStreamWrapperExceptionis thrown if any problems are encountered- Specified by:
buildStreamCompetitorsin interfaceSportEntityFactory- Parameters:
competitorIds- the ids representing the instances that should be builtparentSportEventCi- the parentSportEventCithisCompetitorbelongs tolocales- theLocales in which the data should be available- Returns:
- the constructed objects
-
buildPlayerProfile
public PlayerProfile buildPlayerProfile(Urn id, List<Locale> locales, List<Urn> possibleAssociatedCompetitorIds) - Specified by:
buildPlayerProfilein interfaceSportEntityFactory- Parameters:
id- the player identifierlocales- theLocales in which the data should be availablepossibleAssociatedCompetitorIds- a list of possible associated competitor ids (used to prefetch data)- Returns:
- the constructed object
-
buildCompetitorPlayerProfile
public CompetitorPlayer buildCompetitorPlayerProfile(Urn id, List<Locale> locales, List<Urn> possibleAssociatedCompetitorIds, Map<Urn, Integer> associatedJerseyNumbers) - Specified by:
buildCompetitorPlayerProfilein interfaceSportEntityFactory- Parameters:
id- the player identifierlocales- theLocales in which the data should be availablepossibleAssociatedCompetitorIds- a list of possible associated competitor ids (used to prefetch data)- Returns:
- the constructed object
-