diff options
author | 2018-02-17 04:49:23 +0000 | |
---|---|---|
committer | 2018-02-17 04:49:23 +0000 | |
commit | cfc6897a3951e4e797cb7ab3f81c4b16de976a03 (patch) | |
tree | bc325c75fc176faec39d330accc123bd7ce13221 | |
parent | 554cfd1f1de5a778a7dca547f3fbf6a350094f14 (diff) | |
parent | e26450b7142feae9902b432eb01bcd33f3cbd1bd (diff) |
Merge "Add @Nullable to return values in Uri"
-rw-r--r-- | core/java/android/net/Uri.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java index d5377c717366..1bb4adcebc82 100644 --- a/core/java/android/net/Uri.java +++ b/core/java/android/net/Uri.java @@ -16,6 +16,7 @@ package android.net; +import android.annotation.Nullable; import android.content.Intent; import android.os.Environment; import android.os.Parcel; @@ -23,6 +24,8 @@ import android.os.Parcelable; import android.os.StrictMode; import android.util.Log; +import libcore.net.UriCodec; + import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -38,8 +41,6 @@ import java.util.Objects; import java.util.RandomAccess; import java.util.Set; -import libcore.net.UriCodec; - /** * Immutable URI reference. A URI reference includes a URI and a fragment, the * component of the URI following a '#'. Builds and parses URI references @@ -174,6 +175,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the scheme or null if this is a relative URI */ + @Nullable public abstract String getScheme(); /** @@ -208,6 +210,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the authority for this URI or null if not present */ + @Nullable public abstract String getAuthority(); /** @@ -219,6 +222,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the authority for this URI or null if not present */ + @Nullable public abstract String getEncodedAuthority(); /** @@ -228,6 +232,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the user info for this URI or null if not present */ + @Nullable public abstract String getUserInfo(); /** @@ -237,6 +242,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the user info for this URI or null if not present */ + @Nullable public abstract String getEncodedUserInfo(); /** @@ -246,6 +252,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the host for this URI or null if not present */ + @Nullable public abstract String getHost(); /** @@ -262,6 +269,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * @return the decoded path, or null if this is not a hierarchical URI * (like "mailto:nobody@google.com") or the URI is invalid */ + @Nullable public abstract String getPath(); /** @@ -270,6 +278,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * @return the encoded path, or null if this is not a hierarchical URI * (like "mailto:nobody@google.com") or the URI is invalid */ + @Nullable public abstract String getEncodedPath(); /** @@ -280,6 +289,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the decoded query or null if there isn't one */ + @Nullable public abstract String getQuery(); /** @@ -290,6 +300,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the encoded query or null if there isn't one */ + @Nullable public abstract String getEncodedQuery(); /** @@ -297,6 +308,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the decoded fragment or null if there isn't one */ + @Nullable public abstract String getFragment(); /** @@ -304,6 +316,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the encoded fragment or null if there isn't one */ + @Nullable public abstract String getEncodedFragment(); /** @@ -318,6 +331,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * * @return the decoded last segment or null if the path is empty */ + @Nullable public abstract String getLastPathSegment(); /** @@ -1666,6 +1680,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * @throws NullPointerException if key is null * @return the decoded value or null if no parameter is found */ + @Nullable public String getQueryParameter(String key) { if (isOpaque()) { throw new UnsupportedOperationException(NOT_HIERARCHICAL); |