|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.tmatesoft.svn.core.SVNProperties
public class SVNProperties
The SVNProperties class represents an object wrapper for
String to SVNPropertyValue mappings where
String keys represent property names and values - property
values wrapped in SVNPropertyValue objects.
This class is backed by a Map object and brings specific methods
useful for working with version controlled properties.
Objects of this type are modifiable.
| Constructor Summary | |
|---|---|
SVNProperties()
Creates an empty SVNProperties object. |
|
SVNProperties(SVNProperties properties)
Creates a new SVNProperties object copying the given one. |
|
| Method Summary | |
|---|---|
java.util.Map |
asMap()
Returns SVNProperties as Map of String, SVNPropertyValue pairs. |
void |
clear()
Removes all properties from this object. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
SVNProperties |
compareTo(SVNProperties properties)
Compares this object against another one returning a difference between them. |
boolean |
containsName(java.lang.String propertyName)
Tells whether this properties object contains the specified property name. |
boolean |
containsValue(SVNPropertyValue value)
Tells whether this properties object contains the specified property value. |
boolean |
equals(java.lang.Object obj)
Tells whether this object and obj are equal. |
byte[] |
getBinaryValue(java.lang.String propertyName)
Returns a binary property value. |
SVNProperties |
getRegularProperties()
Returns a subset of properties contained in this properties object which suffice for SVNProperty.isRegularProperty(String) clause. |
java.lang.String |
getStringValue(java.lang.String propertyName)
Returns a String property value. |
SVNPropertyValue |
getSVNPropertyValue(java.lang.String propertyName)
Returns a property value as an SVNPropertyValue. |
int |
hashCode()
Returns a hash code of this object. |
boolean |
isEmpty()
Tells if this properties object holds no properties (empty). |
java.util.Set<java.lang.String> |
nameSet()
Returns a set of property names contained by this object. |
void |
put(java.lang.String propertyName,
byte[] propertyValue)
Stores a new property name-to-value mapping in this object. |
void |
put(java.lang.String propertyName,
java.lang.String propertyValue)
Stores a new property name-to-value mapping in this object. |
void |
put(java.lang.String propertyName,
SVNPropertyValue propertyValue)
Stores a new mapping propertyName to
propertyValue in this object. |
void |
putAll(SVNProperties properties)
Puts all properties from the specified properties object to this object. |
SVNPropertyValue |
remove(java.lang.String propertyName)
Removes the specified property from this properties object. |
void |
removeNullValues()
Removes all mappings which values are nulls from this object. |
int |
size()
Returns the number of properties held by this object. |
java.lang.String |
toString()
|
static SVNProperties |
unmodifiableProperties(SVNProperties properties)
Returns an unmodifiable view of the specified properties. |
java.util.Collection |
values()
Returns a collection of property values contained in this properties object. |
static SVNProperties |
wrap(java.util.Map map)
Creates a new SVNProperties object wrapping a given map with
properties. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SVNProperties()
SVNProperties object.
public SVNProperties(SVNProperties properties)
SVNProperties object copying the given one.
properties - an initializer| Method Detail |
|---|
public static SVNProperties wrap(java.util.Map map)
SVNProperties object wrapping a given map with
properties.
map is not stored by this object, instead its contents are
copied into a new Map object (which will be backed by a new
SVNProperties object) according to the following rules:
String, then it's wrapped into
SVNPropertyValue using the
SVNPropertyValue.create(String) method;
if the value is of type byte[], then it's wrapped into
SVNPropertyValue using the
SVNPropertyValue.create(String, byte[]) method;
if the value is of type SVNPropertyValue, then it's not
copied but is put into a new map as is;
map - initial map holding properties
SVNProperties object; if map is null, returns an empty
SVNProperties object created as
new SVNProperties()SVNProperties()public static SVNProperties unmodifiableProperties(SVNProperties properties)
properties.
Any attempt to modify the returned SVNProperties object
result in an UnsupportedOperationException.
properties - SVNProperties object for which an unmodifiable
view is to be returned.
public java.util.Map asMap()
public void put(java.lang.String propertyName,
SVNPropertyValue propertyValue)
propertyName to
propertyValue in this object.
propertyName - property namepropertyValue - property value object
public void put(java.lang.String propertyName,
java.lang.String propertyValue)
propertyValue is converted to an SVNPropertyValue
object through a call to SVNPropertyValue.create(String).
propertyName - property namepropertyValue - property value string
public void put(java.lang.String propertyName,
byte[] propertyValue)
propertyValue is converted to an SVNPropertyValue
object through a call to SVNPropertyValue.create(String, byte[]).
propertyName - property namepropertyValue - property value bytespublic java.lang.String getStringValue(java.lang.String propertyName)
String property value.
propertyName - property name
String
property valuepublic byte[] getBinaryValue(java.lang.String propertyName)
propertyName - property name
public SVNPropertyValue getSVNPropertyValue(java.lang.String propertyName)
SVNPropertyValue.
propertyName - property name
public SVNPropertyValue remove(java.lang.String propertyName)
propertyName - name of the property to remove from this object
public void putAll(SVNProperties properties)
properties - properties objectpublic boolean isEmpty()
public void clear()
public void removeNullValues()
public int size()
public boolean containsName(java.lang.String propertyName)
propertyName - property name
propertyName)public java.util.Set<java.lang.String> nameSet()
public boolean containsValue(SVNPropertyValue value)
value - property value
valuepublic java.util.Collection values()
public SVNProperties getRegularProperties()
SVNProperty.isRegularProperty(String) clause.
SVNProperties object is returnedpublic SVNProperties compareTo(SVNProperties properties)
properties, are put to the result as property name to null mappings. Properties which are present
only in properties but not in this object, are added to the
result. Also result will include those properties which are present in
both objects but have different values; in this case result will include
such properties with values from properties.
properties - another properties object
public int hashCode()
31 +
hash code of the underlying
Map holding the property key to property value mappings.
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
obj are equal.
equals in class java.lang.Objectobj - object to compare with
obj is
either this very object, or is an instance of
SVNProperties with the same contents of properties
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||