|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.tmatesoft.svn.core.SVNPropertyValue
public class SVNPropertyValue
The SVNPropertyValue represents an object wrapper for string and binary version controlled properties providing a set of specific methods to work with them.
Since version 1.2 theSVNKit library supports binary properties as well.
| Method Summary | |
|---|---|
static SVNPropertyValue |
create(java.lang.String propertyValue)
Creates a new property value object representing a text property value. |
static SVNPropertyValue |
create(java.lang.String propertyName,
byte[] data)
Creates a new property value object from the given byte array. |
static SVNPropertyValue |
create(java.lang.String propertyName,
byte[] data,
int offset,
int length)
Creates a new property value object from the given byte array. |
boolean |
equals(java.lang.Object obj)
Says whether this object and obj are equal or not. |
byte[] |
getBytes()
Returns property value bytes. |
static byte[] |
getPropertyAsBytes(SVNPropertyValue value)
Returns byte[] representation of value. |
static java.lang.String |
getPropertyAsString(SVNPropertyValue value)
Returns String representation of value. |
java.lang.String |
getString()
Returns property value string. |
int |
hashCode()
Returns the hash code for this object. |
boolean |
isBinary()
Says whether the property value wrapped by this object is binary or not. |
boolean |
isString()
Says whether the property value wrapped by this object is String or not. |
java.lang.String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static SVNPropertyValue create(java.lang.String propertyName,
byte[] data,
int offset,
int length)
This method is intended to instantiate binary property values. However if propertyName is of
svn domain, then it attempts
to encode the passed bytes into a String value using the
"UTF-8" charset. Finally, the property value object is created via
a call to create(String). In this way the text nature of the property is automatically
preserved to avoid binary/text properties mess.
propertyName - property namedata - array containing property bytesoffset - offset in data to copy bytes fromlength - amount of bytes to copy from data
data is null
public static SVNPropertyValue create(java.lang.String propertyName,
byte[] data)
This method is equivalent to create(propertyName, data, 0, data.length).
propertyName - property namedata - array containing property bytes
data is nullcreate(String, byte[], int, int)public static SVNPropertyValue create(java.lang.String propertyValue)
propertyValue - text property value which is stored as is
propertyValue is nullpublic static byte[] getPropertyAsBytes(SVNPropertyValue value)
byte[] representation of value.
If value is a string property value, then bytes of
the string are encoded using the "UTF-8" charset and returned by this
method. If encoding fails, then bytes are encoded using the default platform's charset.
Otherwise, getBytes() is returned.
value - property value object
value;
null if value is
nullpublic static java.lang.String getPropertyAsString(SVNPropertyValue value)
String representation of value.
If value is a binary property value, then its bytes are
converted to a String encoding them with the "UTF-8" charset
and returned back to the caller. If that encoding fails, bytes are encoded with the default platform's
charset.
Otherwise, getString() is returned.
value - property value object
value is
nullpublic boolean isBinary()
public byte[] getBytes()
String property values.
public boolean isString()
String or not.
public java.lang.String getString()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
obj are equal or not.
equals in class java.lang.Objectobj - object to compare with
obj is the same as this one (by reference)
if obj is an SVNPropertyValue and either has got the same
String value in case this object holds a String value, or
the same byte array contents if this object represents a binary property value
public int hashCode()
string property,
then returns the hash code of the String object. Otherwise, this object represents
a binary property and the hash code of the byte[] array is returned.
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||