diff options
| author | 2020-07-08 05:57:48 +0000 | |
|---|---|---|
| committer | 2020-07-08 05:57:48 +0000 | |
| commit | 855b3be204d3e7499e78a27960d04a9cd3929ced (patch) | |
| tree | 85892d771709c77ea15684f1d3a9a893cd834961 | |
| parent | fdf9d4afead48c12263007d42fd5579ae970d32e (diff) | |
| parent | 526dc71822b8c2584b92fc6b025e62cc88ba70a6 (diff) | |
Merge "Add some more public doc for MacAddress" am: 758d6bd8d0 am: 28d7770303 am: 3b04eba16b am: 526dc71822
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354447
Change-Id: Idb097086b514c76cd7601d833a5cfaedcdc1e616
| -rw-r--r-- | core/java/android/net/MacAddress.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/java/android/net/MacAddress.java b/core/java/android/net/MacAddress.java index 0e10c42e61db..0eb3c1e8ad01 100644 --- a/core/java/android/net/MacAddress.java +++ b/core/java/android/net/MacAddress.java @@ -38,7 +38,9 @@ import java.util.Arrays; * Representation of a MAC address. * * This class only supports 48 bits long addresses and does not support 64 bits long addresses. - * Instances of this class are immutable. + * Instances of this class are immutable. This class provides implementations of hashCode() + * and equals() that make it suitable for use as keys in standard implementations of + * {@link java.util.Map}. */ public final class MacAddress implements Parcelable { @@ -122,12 +124,22 @@ public final class MacAddress implements Parcelable { } /** + * Convert this MacAddress to a byte array. + * + * The returned array is in network order. For example, if this MacAddress is 1:2:3:4:5:6, + * the returned array is [1, 2, 3, 4, 5, 6]. + * * @return a byte array representation of this MacAddress. */ public @NonNull byte[] toByteArray() { return byteAddrFromLongAddr(mAddr); } + /** + * Returns a human-readable representation of this MacAddress. + * The exact format is implementation-dependent and should not be assumed to have any + * particular format. + */ @Override public @NonNull String toString() { return stringAddrFromLongAddr(mAddr); |