Package hec.io.dbf.types
Interface UserType
- All Known Implementing Classes:
PrimitiveArrayToBinary
public interface UserType
This interface should be implemented by user-defined "types".
A "type" class is not the actual property type - it
is a class that knows how to serialize instances of another
class to and from JDBC.
This interface
Implementors must be immutable and must declare a public default constructor.
The actual class mapped by a UserType may be just about anything.
This interface
- abstracts user code from future changes to the Type interface,
- simplifies the implementation of custom types and
- hides certain "internal" interfaces from user code.
Implementors must be immutable and must declare a public default constructor.
The actual class mapped by a UserType may be just about anything.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compare two instances of the class mapped by this type for persistence "equality".int
Get a hashcode for the instance, consistent with persistence "equality"nullSafeGet
(InputStream value) Retrieve an instance of the mapped class from a .void
nullSafeSet
(OutputStream stream, Object value) Write an instance of the mapped class to a output stream.The class returned by nullSafeGet().void
setParameterValues
(Properties prprts)
-
Method Details
-
returnedClass
Class returnedClass()The class returned by nullSafeGet().- Returns:
- Class
-
equals
Compare two instances of the class mapped by this type for persistence "equality". Equality of the persistent state.- Parameters:
x
-y
-- Returns:
- boolean
-
hashCode
Get a hashcode for the instance, consistent with persistence "equality" -
nullSafeGet
Retrieve an instance of the mapped class from a . Implementors should handle possibility of null values.- Parameters:
value
- the value returned from the DBF file- Returns:
- Object
- Throws:
IOException
-
nullSafeSet
Write an instance of the mapped class to a output stream. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index.- Parameters:
stream
- the stream to write the data to.value
- the object to write- Throws:
IOException
-
setParameterValues
- Throws:
IOException
-