public final class PropertySourceChange extends Object implements Serializable
PropertySourceChangeBuilder
.
Created by Anatole on 22.10.2014.Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key)
Checks if the given key is added, or updated AND NOT removed.
|
int |
getAddedSize()
Access the number current added entries.
|
ChangeType |
getChangeType()
Gets the type of change for this PropertySource.
|
Collection<PropertyChangeEvent> |
getEvents()
Get the changes recorded.
|
PropertySource |
getPropertySource()
Get the underlying property provider/configuration.
|
int |
getRemovedSize()
Access the number current removed entries.
|
long |
getTimestamp()
Get the timestamp in millis from the current epoch. it is expected that the timestamp and the version are unique to
identify a changeset.
|
int |
getUpdatedSize()
Access the number current updated entries.
|
String |
getVersion()
Get the base version, usable for optimistic locking.
|
boolean |
isAdded(String key)
Checks if the given key was added.
|
boolean |
isEmpty()
CHecks if the current change set does not contain any changes.
|
boolean |
isRemoved(String key)
Checks if the given key was removed.
|
boolean |
isUpdated(String key)
Checks if the given key was updated.
|
static PropertySourceChange |
ofAdded(PropertySource propertySource)
Create a change event for a new PropertySource that was added.
|
static PropertySourceChange |
ofDeleted(PropertySource propertySource)
Create a change event for a deleted PropertySource.
|
String |
toString() |
public ChangeType getChangeType()
public PropertySource getPropertySource()
public String getVersion()
public long getTimestamp()
public Collection<PropertyChangeEvent> getEvents()
public int getRemovedSize()
public int getAddedSize()
public int getUpdatedSize()
public boolean isRemoved(String key)
key
- the target key, not null.public boolean isAdded(String key)
key
- the target key, not null.public boolean isUpdated(String key)
key
- the target key, not null.public boolean containsKey(String key)
key
- the target key, not null.public boolean isEmpty()
public static PropertySourceChange ofAdded(PropertySource propertySource)
propertySource
- the new property source, not null.public static PropertySourceChange ofDeleted(PropertySource propertySource)
propertySource
- the deleted property source, not null.Copyright © 2014–2015 Apache Software Foundation. All rights reserved.