Skip to content

Commit

Permalink
Fix syntax and punctuation, and add test for connectivity warning for…
Browse files Browse the repository at this point in the history
…mat.

PiperOrigin-RevId: 247976192
  • Loading branch information
susinmotion authored and copybara-github committed May 13, 2019
1 parent fcbd0b7 commit 8df3d19
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
public final class ConnectivityStatus {
/** Enumerates common connectivity statuses and their generic short warnings. */
public enum Status {
NO_CREDENTIALS("No credentials."),
NO_NETWORK("No internet connection."),
NOT_REACHABLE("Service not reachable."),
NO_CREDENTIALS("No credentials"),
NO_NETWORK("No internet connection"),
NOT_REACHABLE("Service not reachable"),
OK("");

/** Generic warning associated with this status. */
Expand All @@ -37,9 +37,9 @@ public enum Status {
/** Generic category type for this status, which contains a generic warning. */
public final Status status;

/** Returns the complete formatted warning for this status. */
public String fullWarning() {
return status.shortWarning + " " + serviceInfo;
@Override
public String toString() {
return serviceInfo.isEmpty() ? status.shortWarning : status.shortWarning + ": " + serviceInfo;
}

/**
Expand Down

0 comments on commit 8df3d19

Please sign in to comment.