Class HeroFinder
java.lang.Object
org.eclipse.microprofile.graphql.tck.apps.superhero.api.HeroFinder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHeroToTeam(String heroName, String teamName) allHeroesIn(String city) allHeroesInTeam(String teamName) allHeroesWithPower(String power) allTeams()battle(String name, LocalDateTime localDateTime) battleWithCorrectDateFormat(String name, LocalDateTime localDateTime) checkInWithCorrectDateFormat(String name, @DateFormat("MM/dd/yyyy") LocalDate localDate) createNewHero(SuperHero newHero) createNewHeroes(List<SuperHero> newHeroes) createNewHeroesWithArray(SuperHero[] newHeroes) createNewTeam(Team newTeam) exportToCSVFile(String name) exportToFile(String name) favouriteDrinkSize(String name, float size) favouriteDrinkSizeInML(String name, @NumberFormat(value="###.## \'ml\'",locale="en-GB") Float size) generateSecretToken(SuperHero hero, boolean maskFirstPart) generateSuperSecretToken(SuperHero hero, boolean maskFirstPart) getCurrentLocation(SuperHero hero) getItemById(long id) heroByName(String heroName) idNumberWithCorrectFormat(String name, Long idNumber) importantDates(String name, List<LocalDate> localDates) importantDatesUS(String name, List<@DateFormat("MM/dd/yyyy") LocalDate> localDates) logLocation(String name, LinkedList<BigDecimal> coordinates) logLocationLongLat(String name, List<BigDecimal> coordinates) logLocationLongLatWithArray(String name, BigDecimal[] coordinates) logLocationWithArray(String name, BigDecimal[] coordinates) provisionHero(String heroName, Item item) removeHero(String heroName) removeHeroFromTeam(String heroName, String teamName) removeItemFromHero(String heroName, long itemID) removeTeam(String teamName) setRivalTeam(String teamName, Team rivalTeam) startPatrolling(String name, LocalTime localTime) startPatrollingWithCorrectDateFormat(String name, LocalTime localTime) trackHero(String name, List<List<BigDecimal>> coordinates) trackHeroLongLat(String name, List<List<@NumberFormat(value="00.0000000 longlat",locale="en-GB") BigDecimal>> coordinates) updateBankBalance(String name, double bankBalance) updateBankBalanceInUS(String name, Double bankBalance) updateItemPowerLevel(long itemID, int newLevel) updateItemPowerLevelPercentage(long itemID, int newLevel) updateNetWorth(String name, BigDecimal netWorth) updateNetWorthInUSD(String name, BigDecimal netWorth) wreakHavoc(String name)
-
Constructor Details
-
HeroFinder
public HeroFinder()
-
-
Method Details
-
character
- Throws:
UnknownCharacterException
-
superHero
@Query public SuperHero superHero(@Name("name") @Description("Super hero name, not real name") String name) throws UnknownHeroException - Throws:
UnknownHeroException
-
exportToFile
@Query @Description("Testing the blacklist of Checked Exceptions") public SuperHero exportToFile(@Name("name") @Description("Super hero name, not real name") String name) throws IOException - Throws:
IOException
-
exportToCSVFile
@Query @Description("Testing the blacklist of transitive Checked Exceptions") public SuperHero exportToCSVFile(@Name("name") @Description("Super hero name, not real name") String name) throws CsvIOException - Throws:
CsvIOException
-
villian
@Query @Description("Testing the default blacklist for Runtime Exceptions") public SuperHero villian(@Name("name") @Description("Super hero name, not real name") String name) -
weakness
@Query @Description("Testing the whitelist for Runtime Exceptions") public SuperHero weakness(@Name("name") @Description("Super hero name, not real name") String name) -
findFlaw
@Query @Description("Testing the whitelist for transitive Runtime Exceptions") public SuperHero findFlaw(@Name("name") @Description("Super hero name, not real name") String name) -
wreakHavoc
@Query @Description("Testing Errors, as in Java Error") public SuperHero wreakHavoc(@Name("name") @Description("Super hero name, not real name") String name) -
allHeroes
@Query @Description("List all super heroes in the database") public Collection<SuperHero> allHeroes() -
allHeroesIn
@Query public Collection<SuperHero> allHeroesIn(@DefaultValue("New York, NY") @Name("city") String city) -
allHeroesWithPower
-
allHeroesInTeam
@Query public Collection<SuperHero> allHeroesInTeam(@Name("team") String teamName) throws UnknownTeamException - Throws:
UnknownTeamException
-
getTeam
- Throws:
UnknownTeamException
-
allTeams
-
createNewHero
@Mutation public SuperHero createNewHero(@Name("hero") SuperHero newHero) throws DuplicateSuperHeroException, UnknownHeroException -
createNewHeroes
@Mutation public Collection<SuperHero> createNewHeroes(@Name("heroes") List<SuperHero> newHeroes) throws DuplicateSuperHeroException, UnknownHeroException -
createNewHeroesWithArray
@Mutation public SuperHero[] createNewHeroesWithArray(@Name("heroes") SuperHero[] newHeroes) throws DuplicateSuperHeroException, UnknownHeroException -
addHeroToTeam
@Mutation @Description("Adds a hero to the specified team and returns the updated team.") public Team addHeroToTeam(@Name("hero") String heroName, @Name("team") String teamName) throws UnknownTeamException, UnknownHeroException -
removeHeroFromTeam
@Mutation @Description("Removes a hero to the specified team and returns the updated team.") public Team removeHeroFromTeam(@Name("hero") String heroName, @Name("team") String teamName) throws UnknownTeamException, UnknownHeroException -
removeHero
@Mutation @Description("Removes a hero... permanently...") public Collection<SuperHero> removeHero(@Name("hero") String heroName) throws UnknownHeroException - Throws:
UnknownHeroException
-
provisionHero
@Mutation @Description("Gives a hero new equipment") public SuperHero provisionHero(@Name("hero") String heroName, @DefaultValue("{ \"id\": 1000, \"name\": \"Cape\", \"powerLevel\": 3, \"height\": 1.2, \"weight\": 0.3, \"supernatural\": false, \"dateCreated\": \"19 February 1900 at 12:00 in Africa/Johannesburg\", \"dateLastUsed\": \"29 Jan 2020 at 09:45 in zone +0200\"}") @Name("item") Item item) throws UnknownHeroException - Throws:
UnknownHeroException
-
removeItemFromHero
@Mutation @Description("Removes equipment from a hero") public SuperHero removeItemFromHero(@Name("hero") String heroName, @Name("itemID") long itemID) throws UnknownHeroException - Throws:
UnknownHeroException
-
updateItemPowerLevel
@Mutation @Description("Update an item\'s powerLevel") public Item updateItemPowerLevel(@Name("itemID") long itemID, @DefaultValue("5") @Name("powerLevel") int newLevel) -
updateBankBalance
@Mutation @Description("Update a hero\'s bank account") public SuperHero updateBankBalance(@Name("name") String name, @Name("bankBalance") double bankBalance) throws UnknownHeroException - Throws:
UnknownHeroException
-
updateBankBalanceInUS
@Mutation @Description("Update a hero\'s bank account in US Dollar") public SuperHero updateBankBalanceInUS(@Name("name") String name, @Name("bankBalance") Double bankBalance) throws UnknownHeroException - Throws:
UnknownHeroException
-
favouriteDrinkSize
@Mutation @Description("Update a hero\'s favourite drink size") public SuperHero favouriteDrinkSize(@Name("name") String name, @Name("size") float size) throws UnknownHeroException - Throws:
UnknownHeroException
-
favouriteDrinkSizeInML
@Mutation @Description("Update a hero\'s favourite drink size in milliliters") public SuperHero favouriteDrinkSizeInML(@Name("name") String name, @NumberFormat(value="###.## \'ml\'",locale="en-GB") @Name("size") @NumberFormat(value="###.## \'ml\'",locale="en-GB") Float size) throws UnknownHeroException - Throws:
UnknownHeroException
-
updateNetWorth
@Mutation @Description("Update a hero\'s net worth") public SuperHero updateNetWorth(@Name("name") String name, @Name("netWorth") BigDecimal netWorth) throws UnknownHeroException - Throws:
UnknownHeroException
-
updateNetWorthInUSD
@Mutation @Description("Update a hero\'s back account in USD") public SuperHero updateNetWorthInUSD(@Name("name") String name, @Name("netWorth") BigDecimal netWorth) throws UnknownHeroException - Throws:
UnknownHeroException
-
beenThere
@Mutation @Description("All the places this hero has been") public SuperHero beenThere(@Name("name") String name, @Name("places") Set<String> places) throws UnknownHeroException - Throws:
UnknownHeroException
-
logLocation
@Mutation @Description("Log the last place the hero was seen") public SuperHero logLocation(@Name("name") String name, @Name("coordinates") LinkedList<BigDecimal> coordinates) throws UnknownHeroException - Throws:
UnknownHeroException
-
logLocationLongLat
@Mutation @Description("Log the last place the hero was seen (Long Lat)") public SuperHero logLocationLongLat(@Name("name") String name, @Name("coordinates") List<BigDecimal> coordinates) throws UnknownHeroException - Throws:
UnknownHeroException
-
trackHero
@Mutation @Description("Log the last few places the hero was seen") public SuperHero trackHero(@Name("name") String name, @Name("coordinates") List<List<BigDecimal>> coordinates) throws UnknownHeroException - Throws:
UnknownHeroException
-
trackHeroLongLat
@Mutation @Description("Log the last few places the hero was seen (Long Lat)") public SuperHero trackHeroLongLat(@Name("name") String name, @Name("coordinates") List<List<@NumberFormat(value="00.0000000 longlat",locale="en-GB") BigDecimal>> coordinates) throws UnknownHeroException - Throws:
UnknownHeroException
-
logLocationWithArray
@Mutation @Description("Log the last place the hero was seen (using an array)") public SuperHero logLocationWithArray(@Name("name") String name, @Name("coordinates") BigDecimal[] coordinates) throws UnknownHeroException - Throws:
UnknownHeroException
-
logLocationLongLatWithArray
@Mutation @Description("Log the last place the hero was seen (Long Lat) using an array") public SuperHero logLocationLongLatWithArray(@Name("name") String name, @Name("coordinates") BigDecimal[] coordinates) throws UnknownHeroException - Throws:
UnknownHeroException
-
updateItemPowerLevelPercentage
@Mutation @Description("Update an item\'s powerLevel in percentage") public Item updateItemPowerLevelPercentage(@Name("itemID") long itemID, @Name("powerLevel") int newLevel) -
checkIn
@Mutation @Description("Check in a superhero") public SuperHero checkIn(@Name("name") String name, @Name("date") LocalDate localDate) throws UnknownHeroException - Throws:
UnknownHeroException
-
checkInWithCorrectDateFormat
@Mutation @Description("Check in a superhero") public SuperHero checkInWithCorrectDateFormat(@Name("name") String name, @DateFormat("MM/dd/yyyy") @Name("date") @DateFormat("MM/dd/yyyy") LocalDate localDate) throws UnknownHeroException - Throws:
UnknownHeroException
-
importantDates
@Mutation @Description("Set all the important dates for a certain hero") public SuperHero importantDates(@Name("name") String name, @Name("dates") List<LocalDate> localDates) throws UnknownHeroException - Throws:
UnknownHeroException
-
importantDatesUS
@Mutation @Description("Set all the important dates (US format) for a certain hero") public SuperHero importantDatesUS(@Name("name") String name, @Name("dates") List<@DateFormat("MM/dd/yyyy") LocalDate> localDates) throws UnknownHeroException - Throws:
UnknownHeroException
-
startPatrolling
@Mutation @Description("Set the time a hero started patrolling") public SuperHero startPatrolling(@Name("name") String name, @Name("time") LocalTime localTime) throws UnknownHeroException - Throws:
UnknownHeroException
-
startPatrollingWithCorrectDateFormat
@Mutation @Description("Set the time a hero started patrolling (using formatted time)") public SuperHero startPatrollingWithCorrectDateFormat(@Name("name") String name, @Name("time") LocalTime localTime) throws UnknownHeroException - Throws:
UnknownHeroException
-
battle
@Mutation @Description("Start a battle") public SuperHero battle(@Name("name") String name, @Name("dateTime") LocalDateTime localDateTime) throws UnknownHeroException - Throws:
UnknownHeroException
-
battleWithCorrectDateFormat
@Mutation @Description("Start a battle") public SuperHero battleWithCorrectDateFormat(@Name("name") String name, @Name("dateTime") LocalDateTime localDateTime) throws UnknownHeroException - Throws:
UnknownHeroException
-
idNumber
@Mutation @Description("Set the ID Number for a hero") public SuperHero idNumber(@Name("name") String name, @Name("id") Long idNumber) throws UnknownHeroException - Throws:
UnknownHeroException
-
idNumberWithCorrectFormat
@Mutation @Description("Set the ID Number for a hero") public SuperHero idNumberWithCorrectFormat(@Name("name") String name, @Name("id") Long idNumber) throws UnknownHeroException - Throws:
UnknownHeroException
-
getCurrentLocation
@Query public String getCurrentLocation(@Name("superHero") @Source SuperHero hero) throws GraphQLException - Throws:
GraphQLException
-
generateSecretToken
@Name("secretToken") public Token generateSecretToken(@Source SuperHero hero, @DefaultValue("true") @Name("maskFirstPart") boolean maskFirstPart) throws GraphQLException - Throws:
GraphQLException
-
generateSuperSecretToken
public Token generateSuperSecretToken(@Source("superSecretToken") SuperHero hero, @DefaultValue("true") @Name("maskFirstPart") boolean maskFirstPart) throws GraphQLException - Throws:
GraphQLException
-
setRivalTeam
@Mutation("setRivalTeam") public Team setRivalTeam(@Name("teamName") String teamName, @Name("rivalTeam") Team rivalTeam) throws UnknownTeamException - Throws:
UnknownTeamException
-
allHeroesWithError
- Throws:
GraphQLException
-
allHeroesWithSpecificError
- Throws:
SuperHeroLookupException
-
getItemById
-
createNewTeam
-
removeTeam
- Throws:
UnknownTeamException
-
heroUpdates
@Subscription @Description("Receive updates when any hero changes") public Flow.Publisher<SuperHero> heroUpdates() -
heroByName
-
teamUpdates
-