com.hazelcast.spi.merge

## Class DiscardMergePolicy<V,T extends MergingValue<V>>

- java.lang.Object
- - com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy<V,T>
  - - com.hazelcast.spi.merge.DiscardMergePolicy<V,T>

- Type Parameters:
    `V` - the type of the merged value
    `T` - the type of the merging value
  All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable, SplitBrainMergePolicy<V,T>

      public class DiscardMergePolicy<V,T extends MergingValue<V>>
      extends com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy<V,T>

  Merges only entries from the destination data structure and discards all entries from the source data structure.
  Since:
    3.10

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DiscardMergePolicy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getId()` Returns type identifier for this class.
    `V` | `merge(T mergingValue, T existingValue)` Selects the value of either the merging or the existing `MergingValue` which should be merged.

    - ### Methods inherited from class com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy

      `getFactoryId, readData, writeData`

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

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

- - ### Constructor Detail

    - #### DiscardMergePolicy

          public DiscardMergePolicy()

  - ### Method Detail

    - #### merge

          public V merge(T mergingValue,
                         T existingValue)

      Description copied from interface: `SplitBrainMergePolicy`
      Selects the value of either the merging or the existing `MergingValue` which should be merged.

      Note that the existing `MergingValue` instance may be `null` if no matching data could be found to the merging `MergingValue`.

      Parameters:
        `mergingValue` - `MergingValue` instance that has the merging data of the smaller sub-cluster
        `existingValue` - `MergingValue` instance that has the existing data or `null` if no matching data exists
      Returns:
        the selected value for merging

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Returns:
        type ID

Copyright © 2019. All rights reserved.