Go to the documentation of this file.
31 package com.google.protobuf;
36 import java.util.Arrays;
37 import java.util.Collections;
38 import java.util.LinkedHashMap;
52 this.isMutable =
true;
57 this.isMutable =
true;
60 @SuppressWarnings({
"rawtypes",
"unchecked"})
68 @SuppressWarnings({
"unchecked",
"cast"})
75 if (!other.isEmpty()) {
80 @SuppressWarnings({
"unchecked",
"cast"})
83 return isEmpty() ? Collections.<
Map.Entry<
K, V>>emptySet() : super.entrySet();
102 return put(entry.getKey(), entry.getValue());
106 public void putAll(Map<? extends K, ? extends V>
m) {
113 public V
remove(Object
key) {
115 return super.remove(
key);
119 for (Object
key :
m.keySet()) {
121 checkNotNull(
m.get(
key));
125 private static boolean equals(Object
a, Object
b) {
126 if (
a instanceof
byte[] &&
b instanceof
byte[]) {
127 return Arrays.equals((
byte[])
a, (
byte[])
b);
136 static <K, V>
boolean equals(Map<K, V>
a, Map<K, V>
b) {
140 if (
a.size() !=
b.size()) {
143 for (
Map.Entry<
K, V> entry :
a.entrySet()) {
144 if (!
b.containsKey(entry.getKey())) {
147 if (!
equals(entry.getValue(),
b.get(entry.getKey()))) {
155 @SuppressWarnings(
"unchecked")
158 return (
object instanceof
Map) &&
equals(
this, (Map<K, V>)
object);
162 if (
a instanceof
byte[]) {
167 throw new UnsupportedOperationException();
176 static <K, V>
int calculateHashCodeForMap(Map<K, V>
a) {
178 for (
Map.Entry<
K, V> entry :
a.entrySet()) {
187 return calculateHashCodeForMap(
this);
190 private static Object
copy(Object
object) {
191 if (
object instanceof
byte[]) {
192 byte[]
data = (
byte[])
object;
193 return Arrays.copyOf(
data,
data.length);
203 @SuppressWarnings(
"unchecked")
205 Map<K, V> result =
new LinkedHashMap<K, V>();
206 for (
Map.Entry<
K, V> entry :
map.entrySet()) {
207 result.put(entry.getKey(), (V)
copy(entry.getValue()));
232 throw new UnsupportedOperationException();
MapFieldLite(Map< K, V > mapData)
MapFieldLite< K, V > mutableCopy()
static boolean equals(Object a, Object b)
void putAll(Map<? extends K, ? extends V > m)
Set< Map.Entry< K, V > > entrySet()
void mergeFrom(MapFieldLite< K, V > other)
static int hashCode(List< byte[]> list)
GLboolean GLboolean GLboolean b
static final MapFieldLite EMPTY_MAP_FIELD
static int calculateHashCodeForObject(Object a)
static< K, V > MapFieldLite< K, V > emptyMapField()
static void checkForNullKeysAndValues(Map<?, ?> m)
const SETUP_TEARDOWN_TESTCONTEXT char * key
boolean equals(Object object)
static Object copy(Object object)
const upb_json_parsermethod * m
V put(Map.Entry< K, V > entry)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei const GLfloat * value
GLboolean GLboolean GLboolean GLboolean a
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:56