Class AbstractEncoder<T>
- java.lang.Object
-
- org.apache.accumulo.core.client.lexicoder.AbstractEncoder<T>
-
- All Implemented Interfaces:
Encoder<T>
- Direct Known Subclasses:
AbstractLexicoder
,SummingArrayCombiner.StringArrayEncoder
public abstract class AbstractEncoder<T> extends Object implements Encoder<T>
AbstractEncoder is anEncoder
that implements all of Encoder's methods validating the input, but has those methods defer logic to to a new method,decodeUnchecked(byte[], int, int)
.- Since:
- 1.7.0
-
-
Constructor Summary
Constructors Constructor Description AbstractEncoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
decode(byte[] b)
T
decode(byte[] b, int offset, int len)
Checks if the byte array is null, or if parameters exceed the bounds of the byte array, then callsdecodeUnchecked(byte[], int, int)
.protected abstract T
decodeUnchecked(byte[] b, int offset, int len)
Decodes a byte array without checking if the offset and len exceed the bounds of the actual array.
-
-
-
Method Detail
-
decodeUnchecked
protected abstract T decodeUnchecked(byte[] b, int offset, int len) throws IllegalArgumentException
Decodes a byte array without checking if the offset and len exceed the bounds of the actual array.- Throws:
IllegalArgumentException
-
decode
public T decode(byte[] b, int offset, int len)
Checks if the byte array is null, or if parameters exceed the bounds of the byte array, then callsdecodeUnchecked(byte[], int, int)
.- Throws:
NullPointerException
- ifb
is nullIllegalArgumentException
- ifoffset + len
exceeds the length ofb
-
-