Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Helperhaps committed Jan 24, 2019
1 parent c0dcac5 commit daff046
Showing 1 changed file with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class AndroidNotification extends PlatformNotification {
public static final String NOTIFICATION_ANDROID = "android";

private static final String TITLE = "title";
private static final String BUILDER_ID = "builder_id";
private static final String INBOX = "inbox";
Expand All @@ -20,7 +20,7 @@ public class AndroidNotification extends PlatformNotification {
private static final String CATEGORY = "category";
private static final String LARGE_ICON = "large_icon";
private static final String INTENT = "intent";

private final String title;
private final int builderId;
// 0 ~ 4
Expand All @@ -34,15 +34,15 @@ public class AndroidNotification extends PlatformNotification {
private String category;
private String large_icon;
private JsonObject intent;

private AndroidNotification(Object alert, String title, int builderId, int style, int alertType, String bigText,
Object inbox, String bigPicPath, int priority, String category,String large_icon,JsonObject intent,
Map<String, String> extras,
Map<String, Number> numberExtras,
Map<String, Boolean> booleanExtras,
Object inbox, String bigPicPath, int priority, String category,String large_icon,JsonObject intent,
Map<String, String> extras,
Map<String, Number> numberExtras,
Map<String, Boolean> booleanExtras,
Map<String, JsonObject> jsonExtras) {
super(alert, extras, numberExtras, booleanExtras, jsonExtras);

this.title = title;
this.builderId = builderId;
this.style = style;
Expand All @@ -55,16 +55,16 @@ private AndroidNotification(Object alert, String title, int builderId, int style
this.large_icon = large_icon;
this.intent = intent;
}

public static Builder newBuilder() {
return new Builder();
}

public static AndroidNotification alert(String alert) {
return newBuilder().setAlert(alert).build();
}


@Override
public String getPlatform() {
return NOTIFICATION_ANDROID;
Expand All @@ -77,11 +77,11 @@ protected Object getInbox() {
protected void setInbox(Object inbox) {
this.inbox = inbox;
}

@Override
public JsonElement toJSON() {
JsonObject json = super.toJSON().getAsJsonObject();

if (builderId > 0) {
json.add(BUILDER_ID, new JsonPrimitive(this.builderId));
}
Expand Down Expand Up @@ -120,19 +120,19 @@ public JsonElement toJSON() {
if (null != category) {
json.add(CATEGORY, new JsonPrimitive(category));
}

if (null != large_icon) {
json.add(LARGE_ICON, new JsonPrimitive(large_icon));
}

if (null != intent) {
json.add(INTENT, intent);
}

return json;
}


public static class Builder extends PlatformNotification.Builder<AndroidNotification, Builder> {
private String title;
private int builderId;
Expand All @@ -145,21 +145,21 @@ public static class Builder extends PlatformNotification.Builder<AndroidNotifica
private String category;
private String large_icon;
private JsonObject intent;

protected Builder getThis() {
return this;
}

public Builder setTitle(String title) {
this.title = title;
return this;
}

public Builder setBuilderId(int builderId) {
this.builderId = builderId;
return this;
}

public Builder setAlert(Object alert) {
this.alert = alert;
return this;
Expand Down Expand Up @@ -203,22 +203,22 @@ public Builder setInbox(Object inbox) {
this.inbox = inbox;
return this;
}

public Builder setLargeIcon(String largeIcon) {
this.large_icon = largeIcon;
return this;
}

public Builder setIntent(JsonObject intent) {
if (null == inbox) {
if (null == intent) {
LOG.warn("Null intent. Throw away it.");
return this;
}
this.intent = intent;
return this;
}


public AndroidNotification build() {
return new AndroidNotification(alert, title, builderId, style, alert_type, big_text, inbox, big_pic_path, priority,
category, large_icon, intent,extrasBuilder, numberExtrasBuilder, booleanExtrasBuilder, jsonExtrasBuilder);
Expand Down

0 comments on commit daff046

Please sign in to comment.