Returns true if a value is defined for the given key. This is done by linear search, so if it is followed by #get or #getAll, prefer calling them directly and checking the return value against null.
(Key<?> key)
| 231 | * prefer calling them directly and checking the return value against {@code null}. |
| 232 | */ |
| 233 | public boolean containsKey(Key<?> key) { |
| 234 | for (int i = 0; i < size; i++) { |
| 235 | if (bytesEqual(key.asciiName(), name(i))) { |
| 236 | return true; |
| 237 | } |
| 238 | } |
| 239 | return false; |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * Returns the last metadata entry added with the name 'name' parsed as T. |