org.eclipse.microprofile.graphql.tck.apps.superhero.api

## Class HeroFinder

- java.lang.Object
- - org.eclipse.microprofile.graphql.tck.apps.superhero.api.HeroFinder

    @GraphQLApi
    public class HeroFinder
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`HeroFinder()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Team` `addHeroToTeam(String heroName, String teamName)`
`Collection<SuperHero>` `allHeroes()`
`Collection<SuperHero>` `allHeroesIn(String city)`
`Collection<SuperHero>` `allHeroesInTeam(String teamName)`
`Collection<SuperHero>` `allHeroesWithError()`
`Collection<SuperHero>` `allHeroesWithPower(String power)`
`Collection<SuperHero>` `allHeroesWithSpecificError()`
`Collection<Team>` `allTeams()`
`SuperHero` `battle(String name, LocalDateTime localDateTime)`
`SuperHero` `battleWithCorrectDateFormat(String name, LocalDateTime localDateTime)`
`SuperHero` `beenThere(String name, Set<String> places)`
`Character` `character(String name)`
`SuperHero` `checkIn(String name, LocalDate localDate)`
`SuperHero` `checkInWithCorrectDateFormat(String name, @DateFormat(value="MM/dd/yyyy") LocalDate localDate)`
`SuperHero` `createNewHero(SuperHero newHero)`
`Collection<SuperHero>` `createNewHeroes(List<SuperHero> newHeroes)`
`SuperHero[]` `createNewHeroesWithArray(SuperHero[] newHeroes)`
`Team` `createNewTeam(Team newTeam)`
`SuperHero` `exportToCSVFile(String name)`
`SuperHero` `exportToFile(String name)`
`SuperHero` `favouriteDrinkSize(String name, float size)`
`SuperHero` `favouriteDrinkSizeInML(String name, @NumberFormat(value="###.## \'ml\'",locale="en-GB") Float size)`
`SuperHero` `findFlaw(String name)`
`Token` `generateSecretToken(SuperHero hero, boolean maskFirstPart)`
`String` `getCurrentLocation(SuperHero hero)`
`Item` `getItemById(long id)`
`Team` `getTeam(String teamName)`
`SuperHero` `idNumber(String name, Long idNumber)`
`SuperHero` `idNumberWithCorrectFormat(String name, Long idNumber)`
`SuperHero` `importantDates(String name, List<LocalDate> localDates)`
`SuperHero` `importantDatesUS(String name, List<LocalDate> localDates)`
`SuperHero` `logLocation(String name, LinkedList<BigDecimal> coordinates)`
`SuperHero` `logLocationLongLat(String name, List<BigDecimal> coordinates)`
`SuperHero` `logLocationLongLatWithArray(String name, BigDecimal[] coordinates)`
`SuperHero` `logLocationWithArray(String name, BigDecimal[] coordinates)`
`SuperHero` `provisionHero(String heroName, Item item)`
`Collection<SuperHero>` `removeHero(String heroName)`
`Team` `removeHeroFromTeam(String heroName, String teamName)`
`SuperHero` `removeItemFromHero(String heroName, long itemID)`
`Team` `removeTeam(String teamName)`
`Team` `setRivalTeam(String teamName, Team rivalTeam)`
`SuperHero` `startPatrolling(String name, LocalTime localTime)`
`SuperHero` `startPatrollingWithCorrectDateFormat(String name, LocalTime localTime)`
`SuperHero` `superHero(String name)`
`SuperHero` `trackHero(String name, List<List<BigDecimal>> coordinates)`
`SuperHero` `trackHeroLongLat(String name, List<List<BigDecimal>> coordinates)`
`SuperHero` `updateBankBalance(String name, double bankBalance)`
`SuperHero` `updateBankBalanceInUS(String name, Double bankBalance)`
`Item` `updateItemPowerLevel(long itemID, int newLevel)`
`Item` `updateItemPowerLevelPercentage(long itemID, int newLevel)`
`SuperHero` `updateNetWorth(String name, BigDecimal netWorth)`
`SuperHero` `updateNetWorthInUSD(String name, BigDecimal netWorth)`
`SuperHero` `villian(String name)`
`SuperHero` `weakness(String name)`
`SuperHero` `wreakHavoc(String name)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HeroFinder

    public HeroFinder()

### Method Detail

#### character

    @Query
    public Character character(@Name(value="name")
                                      String name)
                               throws UnknownCharacterException

Throws:
  `UnknownCharacterException`

#### superHero

    @Query
    public SuperHero superHero(@Name(value="name") @Description(value="Super hero name, not real name")
                                      String name)
                               throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### exportToFile

    @Query
     @Description(value="Testing the blacklist of Checked Exceptions")
    public SuperHero exportToFile(@Name(value="name") @Description(value="Super hero name, not real name")
                                                                                                            String name)
                                                                                                     throws IOException

Throws:
  `IOException`

#### exportToCSVFile

    @Query
     @Description(value="Testing the blacklist of transitive Checked Exceptions")
    public SuperHero exportToCSVFile(@Name(value="name") @Description(value="Super hero name, not real name")
                                                                                                                          String name)
                                                                                                                   throws CsvIOException

Throws:
  `CsvIOException`

#### villian

    @Query
     @Description(value="Testing the default blacklist for Runtime Exceptions")
    public SuperHero villian(@Name(value="name") @Description(value="Super hero name, not real name")
                                                                                                                String name)

#### weakness

    @Query
     @Description(value="Testing the whitelist for Runtime Exceptions")
    public SuperHero weakness(@Name(value="name") @Description(value="Super hero name, not real name")
                                                                                                         String name)

#### findFlaw

    @Query
     @Description(value="Testing the whitelist for transitive Runtime Exceptions")
    public SuperHero findFlaw(@Name(value="name") @Description(value="Super hero name, not real name")
                                                                                                                    String name)

#### wreakHavoc

    @Query
     @Description(value="Testing Errors, as in Java Error")
    public SuperHero wreakHavoc(@Name(value="name") @Description(value="Super hero name, not real name")
                                                                                               String name)

#### allHeroes

    @Query
     @Description(value="List all super heroes in the database")
    public Collection<SuperHero> allHeroes()

#### allHeroesIn

    @Query
    public Collection<SuperHero> allHeroesIn(@DefaultValue(value="New York, NY") @Name(value="city")
                                                    String city)

#### allHeroesWithPower

    @Query
    public Collection<SuperHero> allHeroesWithPower(@Name(value="power")
                                                           String power)

#### allHeroesInTeam

    @Query
    public Collection<SuperHero> allHeroesInTeam(@Name(value="team")
                                                        String teamName)
                                                 throws UnknownTeamException

Throws:
  `UnknownTeamException`

#### getTeam

    @Query
    public Team getTeam(@Name(value="team")
                               String teamName)
                        throws UnknownTeamException

Throws:
  `UnknownTeamException`

#### allTeams

    @Query
    public Collection<Team> allTeams()

#### createNewHero

    @Mutation
    public SuperHero createNewHero(@Name(value="hero")
                                             SuperHero newHero)
                                      throws DuplicateSuperHeroException,
                                             UnknownHeroException

Throws:
  `DuplicateSuperHeroException`
  `UnknownHeroException`

#### createNewHeroes

    @Mutation
    public Collection<SuperHero> createNewHeroes(@Name(value="heroes")
                                                           List<SuperHero> newHeroes)
                                                    throws DuplicateSuperHeroException,
                                                           UnknownHeroException

Throws:
  `DuplicateSuperHeroException`
  `UnknownHeroException`

#### createNewHeroesWithArray

    @Mutation
    public SuperHero[] createNewHeroesWithArray(@Name(value="heroes")
                                                          SuperHero[] newHeroes)
                                                   throws DuplicateSuperHeroException,
                                                          UnknownHeroException

Throws:
  `DuplicateSuperHeroException`
  `UnknownHeroException`

#### addHeroToTeam

    @Mutation
     @Description(value="Adds a hero to the specified team and returns the updated team.")
    public Team addHeroToTeam(@Name(value="hero")
                                                                                                                               String heroName,
                                                                                                                               @Name(value="team")
                                                                                                                               String teamName)
                                                                                                                        throws UnknownTeamException,
                                                                                                                               UnknownHeroException

Throws:
  `UnknownTeamException`
  `UnknownHeroException`

#### removeHeroFromTeam

    @Mutation
     @Description(value="Removes a hero to the specified team and returns the updated team.")
    public Team removeHeroFromTeam(@Name(value="hero")
                                                                                                                                       String heroName,
                                                                                                                                       @Name(value="team")
                                                                                                                                       String teamName)
                                                                                                                                throws UnknownTeamException,
                                                                                                                                       UnknownHeroException

Throws:
  `UnknownTeamException`
  `UnknownHeroException`

#### removeHero

    @Mutation
     @Description(value="Removes a hero... permanently...")
    public Collection<SuperHero> removeHero(@Name(value="hero")
                                                                                                              String heroName)
                                                                                                       throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### provisionHero

    @Mutation
     @Description(value="Gives a hero new equipment")
    public SuperHero provisionHero(@Name(value="hero")
                                                                                               String heroName,
                                                                                               @DefaultValue(value="{   \"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(value="item")
                                                                                               Item item)
                                                                                        throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### removeItemFromHero

    @Mutation
     @Description(value="Removes equipment from a hero")
    public SuperHero removeItemFromHero(@Name(value="hero")
                                                                                                       String heroName,
                                                                                                       @Name(value="itemID")
                                                                                                       long itemID)
                                                                                                throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### updateItemPowerLevel

    @Mutation
     @Description(value="Update an item\'s powerLevel")
    public Item updateItemPowerLevel(@Name(value="itemID")
                                                                                                   long itemID,
                                                                                                   @DefaultValue(value="5") @Name(value="powerLevel")
                                                                                                   int newLevel)

#### updateBankBalance

    @Mutation
     @Description(value="Update a hero\'s bank account")
    public SuperHero updateBankBalance(@Name(value="name")
                                                                                                      String name,
                                                                                                      @Name(value="bankBalance")
                                                                                                      double bankBalance)
                                                                                               throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### updateBankBalanceInUS

    @Mutation
     @Description(value="Update a hero\'s bank account in US Dollar")
    public SuperHero updateBankBalanceInUS(@Name(value="name")
                                                                                                                       String name,
                                                                                                                       @Name(value="bankBalance")
                                                                                                                       Double bankBalance)
                                                                                                                throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### favouriteDrinkSize

    @Mutation
     @Description(value="Update a hero\'s favourite drink size")
    public SuperHero favouriteDrinkSize(@Name(value="name")
                                                                                                               String name,
                                                                                                               @Name(value="size")
                                                                                                               float size)
                                                                                                        throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### favouriteDrinkSizeInML

    @Mutation
     @Description(value="Update a hero\'s favourite drink size in milliliters")
    public SuperHero favouriteDrinkSizeInML(@Name(value="name")
                                                                                                                                  String name,
                                                                                                                                  @NumberFormat(value="###.## \'ml\'",locale="en-GB") @Name(value="size")
                                                                                                                                  @NumberFormat(value="###.## \'ml\'",locale="en-GB") Float size)
                                                                                                                           throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### updateNetWorth

    @Mutation
     @Description(value="Update a hero\'s net worth")
    public SuperHero updateNetWorth(@Name(value="name")
                                                                                                String name,
                                                                                                @Name(value="netWorth")
                                                                                                BigDecimal netWorth)
                                                                                         throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### updateNetWorthInUSD

    @Mutation
     @Description(value="Update a hero\'s back account in USD")
    public SuperHero updateNetWorthInUSD(@Name(value="name")
                                                                                                               String name,
                                                                                                               @Name(value="netWorth")
                                                                                                               BigDecimal netWorth)
                                                                                                        throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### beenThere

    @Mutation
     @Description(value="All the places this hero has been")
    public SuperHero beenThere(@Name(value="name")
                                                                                                  String name,
                                                                                                  @Name(value="places")
                                                                                                  Set<String> places)
                                                                                           throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### logLocation

    @Mutation
     @Description(value="Log the last place the hero was seen")
    public SuperHero logLocation(@Name(value="name")
                                                                                                       String name,
                                                                                                       @Name(value="coordinates")
                                                                                                       LinkedList<BigDecimal> coordinates)
                                                                                                throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### logLocationLongLat

    @Mutation
     @Description(value="Log the last place the hero was seen (Long Lat)")
    public SuperHero logLocationLongLat(@Name(value="name")
                                                                                                                         String name,
                                                                                                                         @Name(value="coordinates")
                                                                                                                         List<BigDecimal> coordinates)
                                                                                                                  throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### trackHero

    @Mutation
     @Description(value="Log the last few places the hero was seen")
    public SuperHero trackHero(@Name(value="name")
                                                                                                          String name,
                                                                                                          @Name(value="coordinates")
                                                                                                          List<List<BigDecimal>> coordinates)
                                                                                                   throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### trackHeroLongLat

    @Mutation
     @Description(value="Log the last few places the hero was seen (Long Lat)")
    public SuperHero trackHeroLongLat(@Name(value="name")
                                                                                                                            String name,
                                                                                                                            @Name(value="coordinates")
                                                                                                                            List<List<BigDecimal>> coordinates)
                                                                                                                     throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### logLocationWithArray

    @Mutation
     @Description(value="Log the last place the hero was seen (using an array)")
    public SuperHero logLocationWithArray(@Name(value="name")
                                                                                                                                 String name,
                                                                                                                                 @Name(value="coordinates")
                                                                                                                                 BigDecimal[] coordinates)
                                                                                                                          throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### logLocationLongLatWithArray

    @Mutation
     @Description(value="Log the last place the hero was seen (Long Lat) using an array")
    public SuperHero logLocationLongLatWithArray(@Name(value="name")
                                                                                                                                                 String name,
                                                                                                                                                 @Name(value="coordinates")
                                                                                                                                                 BigDecimal[] coordinates)
                                                                                                                                          throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### updateItemPowerLevelPercentage

    @Mutation
     @Description(value="Update an item\'s powerLevel in percentage")
    public Item updateItemPowerLevelPercentage(@Name(value="itemID")
                                                                                                                           long itemID,
                                                                                                                           @Name(value="powerLevel")
                                                                                                                           int newLevel)

#### checkIn

    @Mutation
     @Description(value="Check in a superhero")
    public SuperHero checkIn(@Name(value="name")
                                                                                   String name,
                                                                                   @Name(value="date")
                                                                                   LocalDate localDate)
                                                                            throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### checkInWithCorrectDateFormat

    @Mutation
     @Description(value="Check in a superhero")
    public SuperHero checkInWithCorrectDateFormat(@Name(value="name")
                                                                                                        String name,
                                                                                                        @DateFormat(value="MM/dd/yyyy") @Name(value="date")
                                                                                                        @DateFormat(value="MM/dd/yyyy") LocalDate localDate)
                                                                                                 throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### importantDates

    @Mutation
     @Description(value="Set all the important dates for a certain hero")
    public SuperHero importantDates(@Name(value="name")
                                                                                                                    String name,
                                                                                                                    @Name(value="dates")
                                                                                                                    List<LocalDate> localDates)
                                                                                                             throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### importantDatesUS

    @Mutation
     @Description(value="Set all the important dates (US format) for a certain hero")
    public SuperHero importantDatesUS(@Name(value="name")
                                                                                                                                  String name,
                                                                                                                                  @Name(value="dates")
                                                                                                                                  List<LocalDate> localDates)
                                                                                                                           throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### startPatrolling

    @Mutation
     @Description(value="Set the time a hero started patrolling")
    public SuperHero startPatrolling(@Name(value="name")
                                                                                                             String name,
                                                                                                             @Name(value="time")
                                                                                                             LocalTime localTime)
                                                                                                      throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### startPatrollingWithCorrectDateFormat

    @Mutation
     @Description(value="Set the time a hero started patrolling (using formatted time)")
    public SuperHero startPatrollingWithCorrectDateFormat(@Name(value="name")
                                                                                                                                                         String name,
                                                                                                                                                         @Name(value="time")
                                                                                                                                                         LocalTime localTime)
                                                                                                                                                  throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### battle

    @Mutation
     @Description(value="Start a battle")
    public SuperHero battle(@Name(value="name")
                                                                            String name,
                                                                            @Name(value="dateTime")
                                                                            LocalDateTime localDateTime)
                                                                     throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### battleWithCorrectDateFormat

    @Mutation
     @Description(value="Start a battle")
    public SuperHero battleWithCorrectDateFormat(@Name(value="name")
                                                                                                 String name,
                                                                                                 @Name(value="dateTime")
                                                                                                 LocalDateTime localDateTime)
                                                                                          throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### idNumber

    @Mutation
     @Description(value="Set the ID Number for a hero")
    public SuperHero idNumber(@Name(value="name")
                                                                                            String name,
                                                                                            @Name(value="id")
                                                                                            Long idNumber)
                                                                                     throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### idNumberWithCorrectFormat

    @Mutation
     @Description(value="Set the ID Number for a hero")
    public SuperHero idNumberWithCorrectFormat(@Name(value="name")
                                                                                                             String name,
                                                                                                             @Name(value="id")
                                                                                                             Long idNumber)
                                                                                                      throws UnknownHeroException

Throws:
  `UnknownHeroException`

#### getCurrentLocation

    @Query
    public String getCurrentLocation(@Name(value="superHero") @Source
                                            SuperHero hero)
                                     throws GraphQLException

Throws:
  `GraphQLException`

#### generateSecretToken

    @Name(value="secretToken")
    public Token generateSecretToken(@Source
                                                                SuperHero hero,
                                                                @DefaultValue(value="true") @Name(value="maskFirstPart")
                                                                boolean maskFirstPart)
                                                         throws GraphQLException

Throws:
  `GraphQLException`

#### setRivalTeam

    @Mutation(value="setRivalTeam")
    public Team setRivalTeam(@Name(value="teamName")
                                                             String teamName,
                                                             @Name(value="rivalTeam")
                                                             Team rivalTeam)
                                                      throws UnknownTeamException

Throws:
  `UnknownTeamException`

#### allHeroesWithError

    @Query
    public Collection<SuperHero> allHeroesWithError()
                                                    throws GraphQLException

Throws:
  `GraphQLException`

#### allHeroesWithSpecificError

    @Query
    public Collection<SuperHero> allHeroesWithSpecificError()
                                                            throws SuperHeroLookupException

Throws:
  `SuperHeroLookupException`

#### getItemById

    @Query
    public Item getItemById(@Name(value="id")
                                   long id)

#### createNewTeam

    @Mutation
    public Team createNewTeam(@Name(value="newTeam")
                                        Team newTeam)

#### removeTeam

    @Mutation
    public Team removeTeam(@Name(value="teamName")
                                     String teamName)
                              throws UnknownTeamException

Throws:
  `UnknownTeamException`