Class StringAsByteArrTransformer
- java.lang.Object
-
- cloud.filibuster.junit.server.core.transformers.StringAsByteArrTransformer
-
- All Implemented Interfaces:
Transformer<byte[],java.lang.Integer>
public final class StringAsByteArrTransformer extends java.lang.Object implements Transformer<byte[],java.lang.Integer>
-
-
Constructor Summary
Constructors Constructor Description StringAsByteArrTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.reflect.Type
getAccumulatorType()
Returns Type representation of the accumulator.Accumulator<byte[],java.lang.Integer>
getInitialAccumulator(byte[] referenceValue)
Returns initial accumulator used in the first transformation.Accumulator<byte[],java.lang.Integer>
getNextAccumulator()
Returns accumulator of next transformation.java.lang.reflect.Type
getPayloadType()
Returns Type of the payload.byte[]
getResult()
Returns payload after applying the transformation.boolean
hasNext()
Returns whether current iteration has a successor.StringAsByteArrTransformer
transform(byte[] payload, Accumulator<byte[],java.lang.Integer> accumulator)
Returns transformer instance containing the payload after applying the transformation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cloud.filibuster.junit.server.core.transformers.Transformer
getInitialAccumulator
-
-
-
-
Method Detail
-
transform
@CanIgnoreReturnValue public StringAsByteArrTransformer transform(byte[] payload, Accumulator<byte[],java.lang.Integer> accumulator)
Description copied from interface:Transformer
Returns transformer instance containing the payload after applying the transformation.- Specified by:
transform
in interfaceTransformer<byte[],java.lang.Integer>
- Parameters:
payload
- Value to be transformedaccumulator
- Accumulator of current iteration- Returns:
- Transformer
-
hasNext
public boolean hasNext()
Description copied from interface:Transformer
Returns whether current iteration has a successor.- Specified by:
hasNext
in interfaceTransformer<byte[],java.lang.Integer>
- Returns:
- boolean
-
getPayloadType
public java.lang.reflect.Type getPayloadType()
Description copied from interface:Transformer
Returns Type of the payload.- Specified by:
getPayloadType
in interfaceTransformer<byte[],java.lang.Integer>
- Returns:
- Type of the payload
-
getResult
public byte[] getResult()
Description copied from interface:Transformer
Returns payload after applying the transformation. The transform method should be called at least once before this method.- Specified by:
getResult
in interfaceTransformer<byte[],java.lang.Integer>
- Returns:
- Payload
-
getAccumulatorType
public java.lang.reflect.Type getAccumulatorType()
Description copied from interface:Transformer
Returns Type representation of the accumulator. This method is used to serialize the accumulator in Gson.- Specified by:
getAccumulatorType
in interfaceTransformer<byte[],java.lang.Integer>
- Returns:
- Type representation of the accumulator
-
getInitialAccumulator
public Accumulator<byte[],java.lang.Integer> getInitialAccumulator(byte[] referenceValue)
Description copied from interface:Transformer
Returns initial accumulator used in the first transformation.- Specified by:
getInitialAccumulator
in interfaceTransformer<byte[],java.lang.Integer>
- Parameters:
referenceValue
- reference value used in the initial accumulator- Returns:
- Initial accumulator
-
getNextAccumulator
public Accumulator<byte[],java.lang.Integer> getNextAccumulator()
Description copied from interface:Transformer
Returns accumulator of next transformation.- Specified by:
getNextAccumulator
in interfaceTransformer<byte[],java.lang.Integer>
- Returns:
- Generic accumulator
-
-