com.google.appengine.api.datastore.dev

## Class LocalDatastoreCostAnalysis

- java.lang.Object
- - com.google.appengine.api.datastore.dev.LocalDatastoreCostAnalysis

-     public class LocalDatastoreCostAnalysis
      extends java.lang.Object

  Utility class that can calculate the cost of writing (put or delete) a given `Entity`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalDatastoreCostAnalysis(com.google.appengine.api.datastore.dev.LocalCompositeIndexManager indexManager)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CreationCostAnalysis` | `getCreationCostAnalysis(EntityProto e)`
    `Cost` | `getWriteCost(EntityProto newEntity)` Determines the cost of writing this entity, assuming no previous value exists.
    `Cost` | `getWriteOps(EntityProto oldEntity, EntityProto newEntity)` Determines the cost of writing `newEntity`, assuming its current state in the datastore matches `oldEntity`.

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

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

- - ### Constructor Detail

    - #### LocalDatastoreCostAnalysis

          public LocalDatastoreCostAnalysis(com.google.appengine.api.datastore.dev.LocalCompositeIndexManager indexManager)

  - ### Method Detail

    - #### getCreationCostAnalysis

          public CreationCostAnalysis getCreationCostAnalysis(EntityProto e)

    - #### getWriteCost

          public Cost getWriteCost(EntityProto newEntity)

      Determines the cost of writing this entity, assuming no previous value exists.
      Parameters:
        `newEntity` - The entity whose write cost we are determining.
      Returns:
        The cost of writing the given entity.

    - #### getWriteOps

          public Cost getWriteOps(EntityProto oldEntity,
                         EntityProto newEntity)

      Determines the cost of writing `newEntity`, assuming its current state in the datastore matches `oldEntity`.
      Parameters:
        `oldEntity` - Entity representing the current state in the datastore. Can be `null`.
        `newEntity` - Entity representing the desired state in the datastore.
      Returns:
        The cost of writing `newEntity`.