summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorChalard Jean <jchalard@google.com>2020-07-08 05:38:59 +0000
committerChalard Jean <jchalard@google.com>2020-07-08 09:38:37 +0000
commit7af09d002d676d2997dc996e4f30d4ff918cac44 (patch)
tree8c5b4132ca9babbbe566d03ba4cd2e6f9a9f9356 /core/java
parentcdaa4f3cb0b04b161f69ba0a532f3df25256bf17 (diff)
Add some more public doc for MacAddress
Bug: 140807677 Test: doc-only change Original-Change: https://android-review.googlesource.com/1354447 Merged-In: I0f6e59eda42fd92ec34db0e9bc2d26d2e83d41d0 Change-Id: I0f6e59eda42fd92ec34db0e9bc2d26d2e83d41d0
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/MacAddress.java14
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);