public class BinaryProperty extends ICalProperty
Modifier and Type | Field and Description |
---|---|
protected byte[] |
data |
protected String |
uri |
parameters
Constructor and Description |
---|
BinaryProperty(BinaryProperty original)
Copy constructor.
|
BinaryProperty(byte[] data)
Creates a new binary property.
|
BinaryProperty(File file)
Creates a new binary property.
|
BinaryProperty(String uri)
Creates a new binary property.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
byte[] |
getData()
Gets the property's binary data.
|
String |
getFormatType()
Gets the content-type of the property's value.
|
String |
getUri()
Gets the property's URI.
|
int |
hashCode() |
void |
setData(byte[] data)
Sets the property's binary data.
|
void |
setFormatType(String formatType)
Sets the content-type of the property's value.
|
void |
setUri(String uri)
Sets the property's URI.
|
protected Map<String,Object> |
toStringValues()
Gets string representations of the class's fields for the
ICalProperty.toString() method. |
protected void |
validate(List<ICalComponent> components,
ICalVersion version,
List<ValidationWarning> warnings)
Checks the property for data consistency problems or deviations from the
specifications.
|
addParameter, copy, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, toString, validate
public BinaryProperty(File file) throws IOException
file
- a file containing the binary dataIOException
- if there's a problem reading from the filepublic BinaryProperty(byte[] data)
data
- the binary datapublic BinaryProperty(String uri)
uri
- a URL pointing to the resource (e.g.
"http://example.com/image.png")public BinaryProperty(BinaryProperty original)
original
- the property to make a copy ofpublic byte[] getData()
public void setData(byte[] data)
data
- the binary datapublic String getUri()
public void setUri(String uri)
uri
- the URI (e.g. "http://example.com/image.png")public String getFormatType()
ICalProperty
public void setFormatType(String formatType)
ICalProperty
formatType
- the content type (e.g. "image/png") or null to removeprotected void validate(List<ICalComponent> components, ICalVersion version, List<ValidationWarning> warnings)
ICalProperty
Checks the property for data consistency problems or deviations from the specifications.
This method should be overridden by child classes that wish to provide validation logic. The default implementation of this method does nothing.
validate
in class ICalProperty
components
- the hierarchy of components that the property belongs
toversion
- the version to validate againstwarnings
- the list to add the warnings toprotected Map<String,Object> toStringValues()
ICalProperty
Gets string representations of the class's fields for the
ICalProperty.toString()
method.
Meant to be overridden by child classes. The default implementation returns an empty map.
toStringValues
in class ICalProperty
public int hashCode()
hashCode
in class ICalProperty
public boolean equals(Object obj)
equals
in class ICalProperty
Copyright © 2013–2024 Michael Angstadt. All rights reserved.