Package dev.cel.common.values
Class CelByteString
- java.lang.Object
-
- dev.cel.common.values.CelByteString
-
@Immutable public final class CelByteString extends java.lang.ObjectCelByteString is an immutable sequence of a byte array.
-
-
Field Summary
Fields Modifier and Type Field Description static CelByteStringEMPTY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)inthashCode()Note that we do not use Arrays.hashCode directly due to its implementation using 31 as an odd prime, which is outdated and is more prone to hash collisions.booleanisEmpty()static CelByteStringof(byte[] buffer)intsize()byte[]toByteArray()
-
-
-
Field Detail
-
EMPTY
public static final CelByteString EMPTY
-
-
Method Detail
-
of
public static CelByteString of(byte[] buffer)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
toByteArray
public byte[] toByteArray()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Note that we do not use Arrays.hashCode directly due to its implementation using 31 as an odd prime, which is outdated and is more prone to hash collisions. This code is very similar to what AutoValue generates.- Overrides:
hashCodein classjava.lang.Object
-
-