Mutations (Oracle - Berkeley DB Java API)
Date: 2015-06-18

com.sleepycat.persist.evolve

## Class Mutations

- java.lang.Object
- - com.sleepycat.persist.evolve.Mutations

- All Implemented Interfaces:
    java.io.Serializable

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

  A collection of mutations for configuring class evolution.

  Mutations are configured when a store is opened via `StoreConfig.setMutations`. For example:

        Mutations mutations = new Mutations();
        // Add mutations...
        StoreConfig config = new StoreConfig();
        config.setMutations(mutations);
        EntityStore store = new EntityStore(env, "myStore", config);

  Mutations cause data conversion to occur lazily as instances are read from the store. The `EntityStore.evolve` method may also be used to perform eager conversion.

  Not all incompatible class changes can be handled via mutations. For example, complex refactoring may require a transformation that manipulates multiple entity instances at once. Such changes are not possible with mutations but can made by performing a store conversion.

  See Also:
    `Class Evolution`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Mutations()` Creates an empty set of mutations.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConverter(Converter converter)` Adds a converter mutation.
    `void` | `addDeleter(Deleter deleter)` Adds a deleter mutation.
    `void` | `addRenamer(Renamer renamer)` Adds a renamer mutation.
    `boolean` | `equals(java.lang.Object other)` Returns true if this collection has the same set of mutations as the given collection and all mutations are equal.
    `Converter` | `getConverter(java.lang.String className, int classVersion, java.lang.String fieldName)` Returns the converter mutation for the given class, version and field, or null if none exists.
    `java.util.Collection<Converter>` | `getConverters()` Returns an unmodifiable collection of all converter mutations.
    `Deleter` | `getDeleter(java.lang.String className, int classVersion, java.lang.String fieldName)` Returns the deleter mutation for the given class, version and field, or null if none exists.
    `java.util.Collection<Deleter>` | `getDeleters()` Returns an unmodifiable collection of all deleter mutations.
    `Renamer` | `getRenamer(java.lang.String className, int classVersion, java.lang.String fieldName)` Returns the renamer mutation for the given class, version and field, or null if none exists.
    `java.util.Collection<Renamer>` | `getRenamers()` Returns an unmodifiable collection of all renamer mutations.
    `int` | `hashCode()`
    `boolean` | `isEmpty()` Returns true if no mutations are present.
    `java.lang.String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Mutations

          public Mutations()

      Creates an empty set of mutations.

  - ### Method Detail

    - #### isEmpty

          public boolean isEmpty()

      Returns true if no mutations are present.

    - #### addRenamer

          public void addRenamer(Renamer renamer)

      Adds a renamer mutation.

    - #### getRenamer

          public Renamer getRenamer(java.lang.String className,
                           int classVersion,
                           java.lang.String fieldName)

      Returns the renamer mutation for the given class, version and field, or null if none exists. A null field name should be specified to get a class renamer.

    - #### getRenamers

          public java.util.Collection<Renamer> getRenamers()

      Returns an unmodifiable collection of all renamer mutations.

    - #### addDeleter

          public void addDeleter(Deleter deleter)

      Adds a deleter mutation.

    - #### getDeleter

          public Deleter getDeleter(java.lang.String className,
                           int classVersion,
                           java.lang.String fieldName)

      Returns the deleter mutation for the given class, version and field, or null if none exists. A null field name should be specified to get a class deleter.

    - #### getDeleters

          public java.util.Collection<Deleter> getDeleters()

      Returns an unmodifiable collection of all deleter mutations.

    - #### addConverter

          public void addConverter(Converter converter)

      Adds a converter mutation.

    - #### getConverter

          public Converter getConverter(java.lang.String className,
                               int classVersion,
                               java.lang.String fieldName)

      Returns the converter mutation for the given class, version and field, or null if none exists. A null field name should be specified to get a class converter.

    - #### getConverters

          public java.util.Collection<Converter> getConverters()

      Returns an unmodifiable collection of all converter mutations.

    - #### equals

          public boolean equals(java.lang.Object other)

      Returns true if this collection has the same set of mutations as the given collection and all mutations are equal.
      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright (c) 1996, 2015 Oracle and/or its affiliates. All rights reserved.