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.voidReads data for this persistent data field and writes it into the given file.voidget(Item item, OutputStream sink) Reads data for this persistent data field and writes it into the given stream.voidbyte[]Returns the data of this persistent data field.longReturns the length of the data of this persistent data field.longbooleanbooleanReturns, whether there is no data for this field.lengthMax(long maximumLength) SetValue<?>map(byte[] array) SetValue<?>SetValue<?>map(InputStream stream) SetValue<?>static intmin(int i, long l) optional()Returns a new Field, that differs from this Field by being optional.voidProvides data for this persistent data field.voidset(Item item, DataField.Value data) Provides data for this persistent data field.voidProvides data for this persistent data field.voidset(Item item, InputStream data) Provides data for this persistent data field.voidProvides data for this persistent data field.startsWith(byte[] value) Deprecated.startsWithIfSupported(byte[] value) The result may cause anUnsupportedQueryExceptionwhen used, if the field is stored in avault.toFinal()Returns a new Field, that differs from this Field by being final.static DataField.ValuetoValue(byte[] array) Returns null, ifarrayis null.static DataField.ValueReturns null, iffileis null.static DataField.ValuetoValue(InputStream stream) Returns null, ifstreamis null.static DataField.ValueReturns null, iffileis null.static DataField.ValueReturns null, iffileis null.Methods inherited from class com.exedio.cope.Field
castCollection, check, execute, getColumnName, getInitialExceptions, getInitialType, getPatterns, getValueClass, isFinal, isInitial, isMandatory, mapNullMethods 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:FieldReturns 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:
toFinalin classField<DataField.Value>- See Also:
-
optional
Description copied from class:FieldReturns 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:
optionalin 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:
getin 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- ifsinkis null.IOException- if writingsinkthrows 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- ifsinkis null.IOException- if writingsinkthrows an IOException.
-
set
Provides data for this persistent data field.- Specified by:
setin 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. Closesdataafter 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, ifarrayis null. -
toValue
Returns null, ifstreamis null. -
toValue
Returns null, iffileis null. -
toValue
Returns null, iffileis null. -
toValue
Returns null, iffileis null. -
map
-
map
-
map
-
map
-
getVaultInfo
-
startsWithIfSupported
The result may cause anUnsupportedQueryExceptionwhen used, if the field is stored in avault. -
startsWith
Deprecated.UsestartsWithIfSupported(byte[])instead.
-
startsWithIfSupported(byte[])instead.