public abstract class BaseHashFunction extends BaseOperation<BaseHashFunction.Context> implements Function<BaseHashFunction.Context>
All arguments to this Function
will be concatenated, hashed by the given algorithm
,
then encoded by the current encoding scheme.
If the value is null, an empty string is substituted.
Modifier and Type | Class and Description |
---|---|
protected class |
BaseHashFunction.Context |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
algorithm |
protected java.lang.String |
charsetName |
static java.lang.String |
DEFAULT_ALGORITHM |
static java.lang.String |
DEFAULT_CHARSET |
protected int |
maxLength |
protected SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> |
postEncoding |
protected SerFunction<java.lang.String,java.lang.String> |
preDigest |
fieldDeclaration, numArgs, trace
Constructor and Description |
---|
BaseHashFunction(Fields fieldDeclaration)
Constructor BaseHashFunction creates a new BaseHashFunction instance.
|
BaseHashFunction(Fields fieldDeclaration,
SerFunction<java.lang.String,java.lang.String> preDigest,
SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> postEncoding)
Constructor BaseHashFunction creates a new BaseHashFunction instance.
|
BaseHashFunction(Fields fieldDeclaration,
java.lang.String algorithm)
Constructor BaseHashFunction creates a new BaseHashFunction instance.
|
BaseHashFunction(Fields fieldDeclaration,
java.lang.String algorithm,
int maxLength)
Constructor BaseHashFunction creates a new BaseHashFunction instance.
|
BaseHashFunction(Fields fieldDeclaration,
java.lang.String algorithm,
int maxLength,
SerFunction<java.lang.String,java.lang.String> preDigest,
SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> postEncoding)
Constructor BaseHashFunction creates a new BaseHashFunction instance.
|
BaseHashFunction(Fields fieldDeclaration,
java.lang.String algorithm,
int maxLength,
java.lang.String charsetName)
Constructor BaseHashFunction creates a new BaseHashFunction instance.
|
BaseHashFunction(Fields fieldDeclaration,
java.lang.String algorithm,
int maxLength,
java.lang.String charsetName,
SerFunction<java.lang.String,java.lang.String> preDigest,
SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> postEncoding)
Constructor BaseHashFunction creates a new BaseHashFunction instance.
|
BaseHashFunction(Fields fieldDeclaration,
java.lang.String algorithm,
SerFunction<java.lang.String,java.lang.String> preDigest,
SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> postEncoding)
Constructor BaseHashFunction creates a new BaseHashFunction instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlgorithm()
Method getAlgorithm returns the algorithm of this BaseHashFunction object.
|
protected java.nio.charset.Charset |
getCharset()
Method getCharset returns the charset of this BaseHashFunction object.
|
protected java.security.MessageDigest |
getDigest()
Method getDigest returns the digest of this BaseHashFunction object.
|
protected java.lang.String |
getValue(FunctionCall<BaseHashFunction.Context> functionCall)
Method getValue ...
|
void |
operate(FlowProcess flowProcess,
FunctionCall<BaseHashFunction.Context> functionCall)
Method operate ...
|
protected abstract void |
performEncoding(java.lang.StringBuilder buffer,
byte[] digest)
Method performEncoding ...
|
void |
prepare(FlowProcess flowProcess,
OperationCall<BaseHashFunction.Context> operationCall)
Method prepare ...
|
protected void |
verify()
Method verify ...
|
cleanup, equals, flush, getFieldDeclaration, getNumArgs, getTrace, hashCode, isSafe, printOperationInternal, toString, toStringInternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe
public static final java.lang.String DEFAULT_ALGORITHM
public static final java.lang.String DEFAULT_CHARSET
protected final java.lang.String algorithm
protected final int maxLength
protected final java.lang.String charsetName
protected final SerFunction<java.lang.String,java.lang.String> preDigest
protected final SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> postEncoding
public BaseHashFunction(Fields fieldDeclaration)
fieldDeclaration
- of Fieldspublic BaseHashFunction(Fields fieldDeclaration, SerFunction<java.lang.String,java.lang.String> preDigest, SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> postEncoding)
fieldDeclaration
- of FieldspreDigest
- of SerFunctionpostEncoding
- of SerFunctionpublic BaseHashFunction(Fields fieldDeclaration, java.lang.String algorithm)
fieldDeclaration
- of Fieldsalgorithm
- of Stringpublic BaseHashFunction(Fields fieldDeclaration, java.lang.String algorithm, SerFunction<java.lang.String,java.lang.String> preDigest, SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> postEncoding)
fieldDeclaration
- of Fieldsalgorithm
- of StringpreDigest
- of SerFunctionpostEncoding
- of SerFunctionpublic BaseHashFunction(Fields fieldDeclaration, java.lang.String algorithm, int maxLength)
fieldDeclaration
- of Fieldsalgorithm
- of StringmaxLength
- of intpublic BaseHashFunction(Fields fieldDeclaration, java.lang.String algorithm, int maxLength, SerFunction<java.lang.String,java.lang.String> preDigest, SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> postEncoding)
fieldDeclaration
- of Fieldsalgorithm
- of StringmaxLength
- of intpreDigest
- of SerFunctionpostEncoding
- of SerFunctionpublic BaseHashFunction(Fields fieldDeclaration, java.lang.String algorithm, int maxLength, java.lang.String charsetName)
fieldDeclaration
- of Fieldsalgorithm
- of StringmaxLength
- of intcharsetName
- of Stringpublic BaseHashFunction(Fields fieldDeclaration, java.lang.String algorithm, int maxLength, java.lang.String charsetName, SerFunction<java.lang.String,java.lang.String> preDigest, SerFunction<java.lang.StringBuilder,java.lang.StringBuilder> postEncoding)
fieldDeclaration
- of Fieldsalgorithm
- of StringmaxLength
- of intcharsetName
- of StringpreDigest
- of SerFunctionpostEncoding
- of SerFunctionprotected void verify()
public java.lang.String getAlgorithm()
public void prepare(FlowProcess flowProcess, OperationCall<BaseHashFunction.Context> operationCall)
prepare
in interface Operation<BaseHashFunction.Context>
prepare
in class BaseOperation<BaseHashFunction.Context>
flowProcess
- of FlowProcessoperationCall
- of OperationCallpublic void operate(FlowProcess flowProcess, FunctionCall<BaseHashFunction.Context> functionCall)
operate
in interface Function<BaseHashFunction.Context>
flowProcess
- of FlowProcessfunctionCall
- of FunctionCallprotected abstract void performEncoding(java.lang.StringBuilder buffer, byte[] digest)
buffer
- of StringBuilderdigest
- of byte[]protected java.lang.String getValue(FunctionCall<BaseHashFunction.Context> functionCall)
functionCall
- of FunctionCallprotected java.security.MessageDigest getDigest()
protected java.nio.charset.Charset getCharset()
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.