Skip to content

Commit d77d3a3

Browse files
committed
tidy
1 parent a687a42 commit d77d3a3

File tree

10 files changed

+27
-29
lines changed

10 files changed

+27
-29
lines changed

intercom-java/src/main/java/io/intercom/api/CountItemDeserializer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.fasterxml.jackson.databind.JsonNode;
77
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
88
import com.fasterxml.jackson.databind.node.ObjectNode;
9-
import io.intercom.api.Counts;
109

1110
import java.io.IOException;
1211
import java.util.Map;

intercom-java/src/main/java/io/intercom/api/Counts.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static Counts countQuery(Map<String, String> query) {
2424
return resource.get(Counts.class);
2525
}
2626

27-
public static Counts.Totals appTotals() throws InvalidException, AuthorizationException{
27+
public static Counts.Totals appTotals() throws InvalidException, AuthorizationException {
2828
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path("counts").build());
2929
return resource.get(Totals.class);
3030
}
@@ -42,20 +42,20 @@ public static List<CountItem> userTags() throws InvalidException, AuthorizationE
4242
return countQuery(params).getUser().getTags();
4343
}
4444

45-
public static List<CountItem> userSegments() throws InvalidException, AuthorizationException{
45+
public static List<CountItem> userSegments() throws InvalidException, AuthorizationException {
4646
final HashMap<String, String> params = Maps.newHashMap();
4747
params.put("type", "user");
4848
params.put("count", "segment");
4949
return countQuery(params).getUser().getSegments();
5050
}
5151

52-
public static Counts.Conversation conversationTotals() throws InvalidException, AuthorizationException{
52+
public static Counts.Conversation conversationTotals() throws InvalidException, AuthorizationException {
5353
final HashMap<String, String> params = Maps.newHashMap();
5454
params.put("type", "conversation");
5555
return countQuery(params).getConversation();
5656
}
5757

58-
public static Counts.Conversation conversationAdmins() throws InvalidException, AuthorizationException{
58+
public static Counts.Conversation conversationAdmins() throws InvalidException, AuthorizationException {
5959
final HashMap<String, String> params = Maps.newHashMap();
6060
params.put("type", "conversation");
6161
params.put("count", "admin");
@@ -68,21 +68,21 @@ public static Counts.Conversation conversationAdmins() throws InvalidException,
6868
// return countQuery(params).getCompany().getCompanies();
6969
// }
7070

71-
public static List<CountItem> companySegments() throws InvalidException, AuthorizationException{
71+
public static List<CountItem> companySegments() throws InvalidException, AuthorizationException {
7272
final HashMap<String, String> params = Maps.newHashMap();
7373
params.put("type", "company");
7474
params.put("count", "segment");
7575
return countQuery(params).getCompany().getSegments();
7676
}
7777

78-
public static List<CountItem> companyTags() throws InvalidException, AuthorizationException{
78+
public static List<CountItem> companyTags() throws InvalidException, AuthorizationException {
7979
final HashMap<String, String> params = Maps.newHashMap();
8080
params.put("type", "company");
8181
params.put("count", "tag");
8282
return countQuery(params).getCompany().getTags();
8383
}
8484

85-
public static List<CountItem> companyUsers() throws InvalidException, AuthorizationException{
85+
public static List<CountItem> companyUsers() throws InvalidException, AuthorizationException {
8686
final HashMap<String, String> params = Maps.newHashMap();
8787
params.put("type", "company");
8888
params.put("count", "user");

intercom-java/src/main/java/io/intercom/api/CustomAttributeDeserializer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.fasterxml.jackson.databind.node.JsonNodeType;
88
import com.fasterxml.jackson.databind.node.NumericNode;
99
import com.fasterxml.jackson.databind.node.ValueNode;
10-
import io.intercom.api.CustomAttribute;
1110

1211
import java.io.IOException;
1312

intercom-java/src/main/java/io/intercom/api/Event.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ public static void create(Event event) throws InvalidException, AuthorizationExc
3535

3636
@VisibleForTesting
3737
static void validateCreateEvent(Event event) {
38-
if(Strings.isNullOrEmpty(event.getEventName())) {
38+
if (Strings.isNullOrEmpty(event.getEventName())) {
3939
throw new InvalidException(INVALID_NAME);
4040
}
4141

42-
if(Strings.isNullOrEmpty(event.getUserID())
42+
if (Strings.isNullOrEmpty(event.getUserID())
4343
&& Strings.isNullOrEmpty(event.getEmail())) {
4444
throw new InvalidException(INVALID_USER);
4545
}

intercom-java/src/main/java/io/intercom/api/Note.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ public class Note extends TypedData {
1515

1616
private static final HashMap<String, String> SENTINEL = Maps.newHashMap();
1717

18-
public static Note find(String id)throws InvalidException, AuthorizationException {
18+
public static Note find(String id) throws InvalidException, AuthorizationException {
1919
return DataResource.find(id, "notes", Note.class);
2020
}
2121

22-
public static Note create(Note note)throws InvalidException, AuthorizationException {
22+
public static Note create(Note note) throws InvalidException, AuthorizationException {
2323
return DataResource.create(note, "notes", Note.class);
2424
}
2525

26-
public static NoteCollection list(Map<String, String> params)throws InvalidException, AuthorizationException {
26+
public static NoteCollection list(Map<String, String> params) throws InvalidException, AuthorizationException {
2727
if ((!params.containsKey("email")) && (!params.containsKey("id")) && (!params.containsKey("user_id")) && (!params.containsKey("intercom_user_id"))) {
2828
throw new InvalidException("a notes query must include an email, user_id or intercom_user_id parameter");
2929
}

intercom-java/src/main/java/io/intercom/api/Notification.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
@JsonIgnoreProperties({"intercom"})
1414
public class Notification extends TypedData {
1515

16-
public static Notification readJSON(String json) throws InvalidException {
16+
public static Notification readJSON(String json) throws InvalidException {
1717
try {
1818
return MapperSupport.objectMapper().readValue(json, Notification.class);
1919
} catch (IOException e) {
20-
throw new InvalidException("could not parse json string ["+e.getMessage()+"]", e);
20+
throw new InvalidException("could not parse json string [" + e.getMessage() + "]", e);
2121
}
2222
}
2323

2424
public static Notification readJSON(InputStream json) throws InvalidException {
2525
try {
2626
return MapperSupport.objectMapper().readValue(json, Notification.class);
2727
} catch (IOException e) {
28-
throw new InvalidException("could not parse json stream ["+e.getMessage()+"]", e);
28+
throw new InvalidException("could not parse json stream [" + e.getMessage() + "]", e);
2929
}
3030
}
3131

intercom-java/src/main/java/io/intercom/api/SocialProfileCollection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public String getType() {
2727
}
2828

2929
public List<SocialProfile> getSocialProfiles() {
30-
return socialProfiles == null? null: ImmutableList.<SocialProfile>builder().addAll(socialProfiles).build();
30+
return socialProfiles == null ? null : ImmutableList.<SocialProfile>builder().addAll(socialProfiles).build();
3131
}
3232

3333
@Override

intercom-java/src/main/java/io/intercom/api/Tag.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,20 @@ static TaggableCollection createTagTypedCollection(Tag tag, CompanyCollection co
111111
final String id = company.getId();
112112
final String name = company.getName();
113113

114-
if(company.isUntag()) {
114+
if (company.isUntag()) {
115115
companyMap.put("untag", true);
116116
}
117117

118-
if(!Strings.isNullOrEmpty(companyID)) {
118+
if (!Strings.isNullOrEmpty(companyID)) {
119119
companyMap.put("company_id", companyID);
120120
companiesLite.add(companyMap);
121-
} else if(!Strings.isNullOrEmpty(id)) {
121+
} else if (!Strings.isNullOrEmpty(id)) {
122122
companyMap.put("id", id);
123123
companiesLite.add(companyMap);
124-
} else if(!Strings.isNullOrEmpty(name)) {
124+
} else if (!Strings.isNullOrEmpty(name)) {
125125
companyMap.put("name", name);
126126
companiesLite.add(companyMap);
127-
} else {
127+
} else {
128128
logger.warn("no identifiers found for company tag target, skipping [" + tag + "] [" + company.toString() + "]");
129129
}
130130
taggableCollection.setCompanies(companiesLite);

intercom-java/src/main/java/io/intercom/api/TypedDataCollectionIterator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ public TypedDataCollectionIterator(TypedDataCollection<T> startingCollection) {
1414
}
1515

1616
public boolean hasNext() {
17-
if(pos == rollingCollection.getPageItems().size()) {
18-
if(rollingCollection.hasNextPage()) {
17+
if (pos == rollingCollection.getPageItems().size()) {
18+
if (rollingCollection.hasNextPage()) {
1919
rollingCollection = rollingCollection.nextPage();
2020
pos = 0;
2121
return true;
2222
} else {
2323
return false;
2424
}
25-
} else {
25+
} else {
2626
return pos <= rollingCollection.getPageItems().size();
2727
}
2828
}
@@ -35,8 +35,8 @@ public T next() {
3535
}
3636

3737
private void iterate() {
38-
if(pos == rollingCollection.getPageItems().size()) {
39-
if(rollingCollection.hasNextPage()) {
38+
if (pos == rollingCollection.getPageItems().size()) {
39+
if (rollingCollection.hasNextPage()) {
4040
rollingCollection = rollingCollection.nextPage();
4141
pos = 0;
4242
} else {

intercom-java/src/main/java/io/intercom/api/UriBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private String urlEncode(String param) {
8888
// URLEncoder is a html forms encoder not a percent encoder
8989
return java.net.URLEncoder.encode(param, Charsets.UTF_8.name()).replaceAll("\\+", "%20");
9090
} catch (UnsupportedEncodingException e) {
91-
throw new IntercomException("could not encode url param "+param, e);
91+
throw new IntercomException("could not encode url param " + param, e);
9292
}
9393
}
9494
}

0 commit comments

Comments
 (0)