cascading.tuple.util

## Class TupleHasher

- java.lang.Object
- - cascading.tuple.util.TupleHasher

All Implemented Interfaces:
  java.io.Serializable

    public class TupleHasher
    extends java.lang.Object
    implements java.io.Serializable

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `TupleHasher.HashFunction`

### Field Summary

Fields
`protected TupleHasher.HashFunction` `hashFunction`

### Constructor Summary

Constructors
Constructor and Description
`TupleHasher()`
`TupleHasher(java.util.Comparator defaultComparator, java.util.Comparator[] comparators)`

### Method Summary

Methods
`protected TupleHasher.HashFunction` `getHashFunction()`
`int` `hashCode(Tuple tuple)`
`protected void` `initialize(java.util.Comparator defaultComparator, java.util.Comparator[] comparators)`
`static boolean` `isNull(java.util.Comparator[] comparators)`
`static java.util.Comparator[]` `merge(Fields[] keyFields)`
`static Tuple` `wrapTuple(TupleHasher tupleHasher, Tuple input)` Wraps the given Tuple in a subtype, that uses the provided Hasher for hashCode calculations.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### hashFunction

    protected TupleHasher.HashFunction hashFunction

### Constructor Detail

#### TupleHasher

    public TupleHasher()

#### TupleHasher

    public TupleHasher(java.util.Comparator defaultComparator,
               java.util.Comparator[] comparators)

### Method Detail

#### merge

    public static java.util.Comparator[] merge(Fields[] keyFields)

#### isNull

    public static boolean isNull(java.util.Comparator[] comparators)

#### initialize

    protected void initialize(java.util.Comparator defaultComparator,
                  java.util.Comparator[] comparators)

#### hashCode

    public final int hashCode(Tuple tuple)

#### getHashFunction

    protected TupleHasher.HashFunction getHashFunction()

#### wrapTuple

    public static Tuple wrapTuple(TupleHasher tupleHasher,
                  Tuple input)

Wraps the given Tuple in a subtype, that uses the provided Hasher for hashCode calculations. If the given Hasher is `null` the input Tuple will be returned.

Parameters:
  `tupleHasher` - A TupleHasher instance.
  `input` - A Tuple instance.
Returns:
  A tuple using the provided TupleHasher for hashCode calculations if the TupleHasher is not null.