Package com.exedio.cope
Class DataField
- All Implemented Interfaces:
Settable<DataField.Value>
,Serializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the data of this persistent data field.void
Reads data for this persistent data field and writes it into the given file.void
get
(Item item, OutputStream sink) Reads data for this persistent data field and writes it into the given stream.void
byte[]
Returns the data of this persistent data field.long
Returns the length of the data of this persistent data field.long
boolean
boolean
Returns, whether there is no data for this field.lengthMax
(long maximumLength) SetValue<?>
map
(byte[] array) SetValue<?>
SetValue<?>
map
(InputStream stream) SetValue<?>
static int
min
(int i, long l) optional()
Returns a new Field, that differs from this Field by being optional.void
Provides data for this persistent data field.void
set
(Item item, DataField.Value data) Provides data for this persistent data field.void
Provides data for this persistent data field.void
set
(Item item, InputStream data) Provides data for this persistent data field.void
Provides data for this persistent data field.startsWith
(byte[] value) Deprecated.startsWithIfSupported
(byte[] value) The result may cause anUnsupportedQueryException
when used, if the field is stored in avault
.toFinal()
Returns a new Field, that differs from this Field by being final.static DataField.Value
toValue
(byte[] array) Returns null, ifarray
is null.static DataField.Value
Returns null, iffile
is null.static DataField.Value
toValue
(InputStream stream) Returns null, ifstream
is null.static DataField.Value
Returns null, iffile
is null.static DataField.Value
Returns null, iffile
is null.Methods inherited from class com.exedio.cope.Field
castCollection, check, execute, getColumnName, getInitialExceptions, getInitialType, getPatterns, getValueClass, isFinal, isInitial, isMandatory, mapNull
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, getType, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
Field Details
-
DEFAULT_LENGTH
public static final long DEFAULT_LENGTH- See Also:
-
-
Constructor Details
-
DataField
public DataField()
-
-
Method Details
-
toFinal
Description copied from class:Field
Returns a new Field, that differs from this Field by being final. If this Field is already final, the the result is equal to this Field.- Specified by:
toFinal
in classField<DataField.Value>
- See Also:
-
optional
Description copied from class:Field
Returns a new Field, that differs from this Field by being optional. If this Field is already optional, the the result is equal to this Field.- Specified by:
optional
in classField<DataField.Value>
- See Also:
-
lengthMax
-
getMaximumLength
public long getMaximumLength() -
isAnnotatedVault
public boolean isAnnotatedVault() -
min
public static int min(int i, long l) - Throws:
IllegalArgumentException
- if either i or l is negative
-
isNull
Returns, whether there is no data for this field. -
getLength
Returns the length of the data of this persistent data field. Returns -1, if there is no data for this field. -
get
Returns the data of this persistent data field. Returns null, if there is no data for this field.- Specified by:
get
in classField<DataField.Value>
-
getArray
Returns the data of this persistent data field. Returns null, if there is no data for this field. -
get
Reads data for this persistent data field and writes it into the given stream. Does nothing, if there is no data for this field.- Throws:
NullPointerException
- ifsink
is null.IOException
- if writingsink
throws an IOException.
-
get
- Throws:
IOException
-
get
Reads data for this persistent data field and writes it into the given file. Does nothing, if there is no data for this field.- Throws:
NullPointerException
- ifsink
is null.IOException
- if writingsink
throws an IOException.
-
set
Provides data for this persistent data field.- Specified by:
set
in classField<DataField.Value>
- Parameters:
data
- give null to remove data.- Throws:
MandatoryViolationException
- if data is null and field ismandatory
.DataLengthViolationException
- if data is longer thangetMaximumLength()
-
set
Provides data for this persistent data field.- Parameters:
data
- give null to remove data.- Throws:
MandatoryViolationException
- if data is null and field ismandatory
.DataLengthViolationException
- if data is longer thangetMaximumLength()
-
set
Provides data for this persistent data field. Closesdata
after reading the contents of the stream.- Parameters:
data
- give null to remove data.- Throws:
MandatoryViolationException
- if data is null and field ismandatory
.DataLengthViolationException
- if data is longer thangetMaximumLength()
IOException
- if reading data throws an IOException.
-
set
Provides data for this persistent data field.- Parameters:
data
- give null to remove data.- Throws:
MandatoryViolationException
- if data is null and field ismandatory
.DataLengthViolationException
- if data is longer thangetMaximumLength()
IOException
- if reading data throws an IOException.
-
set
Provides data for this persistent data field.- Parameters:
data
- give null to remove data.- Throws:
MandatoryViolationException
- if data is null and field ismandatory
.DataLengthViolationException
- if data is longer thangetMaximumLength()
IOException
- if reading data throws an IOException.
-
toValue
Returns null, ifarray
is null. -
toValue
Returns null, ifstream
is null. -
toValue
Returns null, iffile
is null. -
toValue
Returns null, iffile
is null. -
toValue
Returns null, iffile
is null. -
map
-
map
-
map
-
map
-
getVaultInfo
-
startsWithIfSupported
The result may cause anUnsupportedQueryException
when used, if the field is stored in avault
. -
startsWith
Deprecated.UsestartsWithIfSupported(byte[])
instead.
-
startsWithIfSupported(byte[])
instead.