com.netflix.config
Class WatchedUpdateResult

java.lang.Object
  extended by com.netflix.config.WatchedUpdateResult
Direct Known Subclasses:
PollResult

public class WatchedUpdateResult
extends java.lang.Object

This class represents the result of a callback from the WatchedConfigurationSource. The result may be the complete content of the configuration source - or an incremental one.


Field Summary
protected  java.util.Map<java.lang.String,java.lang.Object> added
           
protected  java.util.Map<java.lang.String,java.lang.Object> changed
           
protected  java.util.Map<java.lang.String,java.lang.Object> complete
           
protected  java.util.Map<java.lang.String,java.lang.Object> deleted
           
protected  boolean incremental
           
 
Method Summary
static WatchedUpdateResult createFull(java.util.Map<java.lang.String,java.lang.Object> complete)
          Create a full result that represents the complete content of the configuration source.
static WatchedUpdateResult createIncremental(java.util.Map<java.lang.String,java.lang.Object> added, java.util.Map<java.lang.String,java.lang.Object> changed, java.util.Map<java.lang.String,java.lang.Object> deleted)
          Create a result that represents incremental changes from the configuration source.
 java.util.Map<java.lang.String,java.lang.Object> getAdded()
           
 java.util.Map<java.lang.String,java.lang.Object> getChanged()
           
 java.util.Map<java.lang.String,java.lang.Object> getComplete()
          Get complete content from configuration source.
 java.util.Map<java.lang.String,java.lang.Object> getDeleted()
           
 boolean hasChanges()
          Indicate whether this result has any content.
 boolean isIncremental()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

complete

protected final java.util.Map<java.lang.String,java.lang.Object> complete

added

protected final java.util.Map<java.lang.String,java.lang.Object> added

changed

protected final java.util.Map<java.lang.String,java.lang.Object> changed

deleted

protected final java.util.Map<java.lang.String,java.lang.Object> deleted

incremental

protected final boolean incremental
Method Detail

createFull

public static WatchedUpdateResult createFull(java.util.Map<java.lang.String,java.lang.Object> complete)
Create a full result that represents the complete content of the configuration source.

Parameters:
complete - map that contains all the properties

createIncremental

public static WatchedUpdateResult createIncremental(java.util.Map<java.lang.String,java.lang.Object> added,
                                                    java.util.Map<java.lang.String,java.lang.Object> changed,
                                                    java.util.Map<java.lang.String,java.lang.Object> deleted)
Create a result that represents incremental changes from the configuration source.

Parameters:
added - properties added
changed - properties changed
deleted - properties deleted, in which case the value in the map will be ignored

hasChanges

public boolean hasChanges()
Indicate whether this result has any content. If the result is incremental, this is true if there is any any added, changed or deleted properties. If the result is complete, this is true if getComplete() is null.


getComplete

public final java.util.Map<java.lang.String,java.lang.Object> getComplete()
Get complete content from configuration source. null if the result is incremental.


getAdded

public final java.util.Map<java.lang.String,java.lang.Object> getAdded()
Returns:
the added properties in the configuration source as a map

getChanged

public final java.util.Map<java.lang.String,java.lang.Object> getChanged()
Returns:
the changed properties in the configuration source as a map

getDeleted

public final java.util.Map<java.lang.String,java.lang.Object> getDeleted()
Returns:
the deleted properties in the configuration source as a map

isIncremental

public final boolean isIncremental()
Returns:
whether the result is incremental. false if it is the complete content of the configuration source.