Package org.apache.jackrabbit.value
Class BinaryValue
- java.lang.Object
-
- org.apache.jackrabbit.value.BaseValue
-
- org.apache.jackrabbit.value.BinaryValue
-
- All Implemented Interfaces:
javax.jcr.Value
public class BinaryValue extends BaseValue
ABinaryValueprovides an implementation of theValueinterface representing a binary value.
-
-
Field Summary
Fields Modifier and Type Field Description static intTYPE
-
Constructor Summary
Constructors Constructor Description BinaryValue(byte[] data)Constructs aBinaryValueobject based on a byte array.BinaryValue(java.io.InputStream stream)Constructs aBinaryValueobject based on a stream.BinaryValue(java.lang.String text)Constructs aBinaryValueobject based on a string.BinaryValue(javax.jcr.Binary bin)Constructs aBinaryValueobject based on aBinary.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Indicates whether some other object is "equal to" this one.javax.jcr.BinarygetBinary()java.lang.StringgetInternalString()Gets the string representation of this binary value.java.io.InputStreamgetStream()inthashCode()Returns zero to satisfy the Object equals/hashCode contract.-
Methods inherited from class org.apache.jackrabbit.value.BaseValue
getBoolean, getDate, getDecimal, getDouble, getLong, getString, getType
-
-
-
-
Field Detail
-
TYPE
public static final int TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BinaryValue
public BinaryValue(java.lang.String text)
Constructs aBinaryValueobject based on a string.- Parameters:
text- the string thisBinaryValueshould represent
-
BinaryValue
public BinaryValue(javax.jcr.Binary bin)
Constructs aBinaryValueobject based on aBinary.- Parameters:
bin- the bytes thisBinaryValueshould represent
-
BinaryValue
public BinaryValue(java.io.InputStream stream)
Constructs aBinaryValueobject based on a stream.- Parameters:
stream- the stream thisBinaryValueshould represent
-
BinaryValue
public BinaryValue(byte[] data)
Constructs aBinaryValueobject based on a byte array.- Parameters:
data- the bytes thisBinaryValueshould represent
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.The result is
trueif and only if the argument is notnulland is aBinaryValueobject that represents the same value as this object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.
-
hashCode
public int hashCode()
Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.- Overrides:
hashCodein classjava.lang.Object- Returns:
- always zero
- See Also:
Object.hashCode()
-
getInternalString
public java.lang.String getInternalString() throws javax.jcr.ValueFormatException, javax.jcr.RepositoryExceptionGets the string representation of this binary value.- Returns:
- string representation of this binary value.
- Throws:
javax.jcr.ValueFormatExceptionjavax.jcr.RepositoryException- if another error occurs
-
getStream
public java.io.InputStream getStream() throws java.lang.IllegalStateException, javax.jcr.RepositoryException
-
getBinary
public javax.jcr.Binary getBinary() throws javax.jcr.ValueFormatException, java.lang.IllegalStateException, javax.jcr.RepositoryException
-
-