Skip to content

Commit 7690d8c

Browse files
committed
Apply code style to the whole project
1 parent b913cfc commit 7690d8c

File tree

62 files changed

+2087
-2084
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2087
-2084
lines changed

example/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
34
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
45
<modelVersion>4.0.0</modelVersion>
56

example/src/main/java/com/coxautodev/graphql/tools/example/CharacterRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class CharacterRepository {
2121
private Map<Episode, Character> heroes;
2222

2323
public CharacterRepository() {
24-
Human lukeSkywalker = new Human("1000", "Luke Skywalker", Arrays.asList(Episode.NEWHOPE, Episode.JEDI, Episode.EMPIRE),"Tatooine");
24+
Human lukeSkywalker = new Human("1000", "Luke Skywalker", Arrays.asList(Episode.NEWHOPE, Episode.JEDI, Episode.EMPIRE), "Tatooine");
2525
Human darthVader = new Human("1001", "Darth Vader", Arrays.asList(Episode.NEWHOPE, Episode.JEDI, Episode.EMPIRE), "Tatooine");
2626
Human hanSolo = new Human("1002", "Han Solo", Arrays.asList(Episode.NEWHOPE, Episode.JEDI, Episode.EMPIRE), null);
2727
Human leiaOrgana = new Human("1003", "Leia Organa", Arrays.asList(Episode.NEWHOPE, Episode.JEDI, Episode.EMPIRE), "Alderaan");

example/src/main/java/com/coxautodev/graphql/tools/example/resolvers/Mutation.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@Component
1111
public class Mutation implements GraphQLMutationResolver {
1212

13-
public Human createHuman(Map<String,String> createHumanInput) {
13+
public Human createHuman(Map<String, String> createHumanInput) {
1414
String name = null;
1515
if (createHumanInput.containsKey("name")) {
1616
name = createHumanInput.get("name");
@@ -21,5 +21,4 @@ public Human createHuman(Map<String,String> createHumanInput) {
2121
}
2222
return new Human(UUID.randomUUID().toString(), name, null, homePlanet);
2323
}
24-
2524
}

example/src/main/java/com/coxautodev/graphql/tools/example/resolvers/Query.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,26 @@
1313
@Component
1414
public class Query implements GraphQLQueryResolver {
1515

16-
@Autowired
17-
private CharacterRepository characterRepository;
16+
@Autowired private CharacterRepository characterRepository;
1817

1918
public Character hero(Episode episode) {
20-
return episode != null ? characterRepository.getHeroes().get(episode) : characterRepository.getCharacters().get("1000");
19+
return episode != null ? characterRepository.getHeroes().get(episode) : characterRepository.getCharacters()
20+
.get("1000");
2121
}
2222

2323
public Human human(String id, DataFetchingEnvironment env) {
24-
return (Human) characterRepository.getCharacters().values().stream()
24+
return (Human) characterRepository.getCharacters()
25+
.values()
26+
.stream()
2527
.filter(character -> character instanceof Human && character.getId().equals(id))
2628
.findFirst()
2729
.orElseGet(null);
2830
}
2931

3032
public Droid droid(String id) {
31-
return (Droid) characterRepository.getCharacters().values().stream()
33+
return (Droid) characterRepository.getCharacters()
34+
.values()
35+
.stream()
3236
.filter(character -> character instanceof Droid && character.getId().equals(id))
3337
.findFirst()
3438
.orElseGet(null);

example/src/main/java/com/coxautodev/graphql/tools/example/types/Character.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
import java.util.List;
44

55
public interface Character {
6+
67
String getId();
8+
79
String getName();
10+
811
List<Character> getFriends();
12+
913
List<Episode> getAppearsIn();
1014
}

example/src/main/java/com/coxautodev/graphql/tools/example/types/Droid.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.List;
66

77
public class Droid implements Character {
8+
89
private String id;
910
private String name;
1011
private List<Character> friends = new ArrayList<>();
@@ -18,7 +19,7 @@ public Droid(String id, String name, List<Episode> appearsIn, String primaryFunc
1819
this.primaryFunction = primaryFunction;
1920
}
2021

21-
public void addFriends(Character ... friends) {
22+
public void addFriends(Character... friends) {
2223
this.friends.addAll(Arrays.asList(friends));
2324
}
2425

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package graphql.kickstart.tools.example.types;
22

33
public enum Episode {
4-
NEWHOPE,
5-
EMPIRE,
6-
JEDI
4+
NEWHOPE, EMPIRE, JEDI
75
}

example/src/main/java/com/coxautodev/graphql/tools/example/types/Human.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.List;
66

77
public class Human implements Character {
8+
89
private String id;
910
private String name;
1011
private List<Character> friends = new ArrayList<>();
@@ -18,7 +19,7 @@ public Human(String id, String name, List<Episode> appearsIn, String homePlanet)
1819
this.homePlanet = homePlanet;
1920
}
2021

21-
public void addFriends(Character ... friends) {
22+
public void addFriends(Character... friends) {
2223
this.friends.addAll(Arrays.asList(friends));
2324
}
2425

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
11
type Query {
2-
# If episode omitted, returns the hero of the whole saga. If provided, returns the hero of that particular episode
3-
hero(episode: Episode): Character
4-
# Find human by id
5-
human(id: String!): Human
6-
# Find droid by id
7-
droid(id: String!): Droid
8-
# Find character by id
9-
character(id: String!): Character
2+
# If episode omitted, returns the hero of the whole saga. If provided, returns the hero of that particular episode
3+
hero(episode: Episode): Character
4+
# Find human by id
5+
human(id: String!): Human
6+
# Find droid by id
7+
droid(id: String!): Droid
8+
# Find character by id
9+
character(id: String!): Character
1010
}
1111

1212
# One of the films in the Star Wars Trilogy
1313
enum Episode {
14-
# Released in 1977
15-
NEWHOPE,
16-
# Released in 1980
17-
EMPIRE,
18-
# Released in 1983
19-
JEDI
14+
# Released in 1977
15+
NEWHOPE,
16+
# Released in 1980
17+
EMPIRE,
18+
# Released in 1983
19+
JEDI
2020
}
2121

2222
# A character in the Star Wars Trilogy
2323
interface Character {
24-
# The id of the character
25-
id: String!
26-
# The name of the character
27-
name: String
28-
# The friends of the character, or an empty list if they have none
29-
friends: [Character]
30-
# Which movies they appear in
31-
appearsIn: [Episode]
24+
# The id of the character
25+
id: String!
26+
# The name of the character
27+
name: String
28+
# The friends of the character, or an empty list if they have none
29+
friends: [Character]
30+
# Which movies they appear in
31+
appearsIn: [Episode]
3232
}
3333

3434
# A humanoid creature in the Star Wars universe
3535
type Human implements Character {
36-
# The id of the human
37-
id: String!
38-
# The name of the human
39-
name: String
40-
# The friends of the human, or an empty list if they have none
41-
friends: [Character]
42-
# Which movies they appear in
43-
appearsIn: [Episode]
44-
# The home planet of the human, or null if unknown
45-
homePlanet: String
36+
# The id of the human
37+
id: String!
38+
# The name of the human
39+
name: String
40+
# The friends of the human, or an empty list if they have none
41+
friends: [Character]
42+
# Which movies they appear in
43+
appearsIn: [Episode]
44+
# The home planet of the human, or null if unknown
45+
homePlanet: String
4646
}
4747

4848
# A mechanical creature in the Star Wars universe
4949
type Droid implements Character {
50-
# The id of the droid
51-
id: String!
52-
# The name of the droid
53-
name: String
54-
# The friends of the droid, or an empty list if they have none
55-
friends: [Character]
56-
# Which movies they appear in
57-
appearsIn: [Episode]
58-
# The primary function of the droid
59-
primaryFunction: String
50+
# The id of the droid
51+
id: String!
52+
# The name of the droid
53+
name: String
54+
# The friends of the droid, or an empty list if they have none
55+
friends: [Character]
56+
# Which movies they appear in
57+
appearsIn: [Episode]
58+
# The primary function of the droid
59+
primaryFunction: String
6060
}
6161

6262
type Mutation {
63-
# Creates a new human character
64-
createHuman(input: CreateHumanInput!): Human
63+
# Creates a new human character
64+
createHuman(input: CreateHumanInput!): Human
6565
}
6666

6767
input CreateHumanInput {
68-
# The name of the human
69-
name: String
70-
# The home planet of the human, or null if unknown
71-
homePlanet: String
68+
# The name of the human
69+
name: String
70+
# The home planet of the human, or null if unknown
71+
homePlanet: String
7272
}

pom.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
35
<modelVersion>4.0.0</modelVersion>
46

57
<groupId>com.graphql-java-kickstart</groupId>
@@ -309,7 +311,7 @@
309311
</goals>
310312
<configuration>
311313
<rules>
312-
<dependencyConvergence />
314+
<dependencyConvergence/>
313315
</rules>
314316
</configuration>
315317
</execution>
@@ -380,11 +382,14 @@
380382
<repository>
381383
<id>bintray</id>
382384
<name>graphql-java-kickstart-graphql-java-tools</name>
383-
<url>https://api.bintray.com/maven/graphql-java-kickstart/releases/graphql-java-tools/;publish=1</url>
385+
<url>
386+
https://api.bintray.com/maven/graphql-java-kickstart/releases/graphql-java-tools/;publish=1
387+
</url>
384388
</repository>
385389
</distributionManagement>
386390
<scm>
387-
<connection>scm:git:https://github.com/graphql-java-kickstart/graphql-java-tools.git</connection>
391+
<connection>scm:git:https://github.com/graphql-java-kickstart/graphql-java-tools.git
392+
</connection>
388393
<developerConnection>scm:git:https://github.com/graphql-java-kickstart/graphql-java-tools.git
389394
</developerConnection>
390395
<url>https://github.com/graphql-java-kickstart/graphql-java-tools</url>

0 commit comments

Comments
 (0)