Package org.opensaml.storage

# Interface StorageSerializer<Type>

Type Parameters:
  `Type` - the type of object handled

All Superinterfaces:
  `Component`, `InitializableComponent`

All Known Implementing Classes:
  `StorageServiceSAMLArtifactMapEntryFactory`

@ThreadSafeAfterInit public interface StorageSerializer<Type> extends InitializableComponent
Interface to a serialization/deserialization process used by a `StorageService` implementation to optimize the handling of complex objects.

## Method Summary

Modifier and Type
Method
Description
`Type`
`deserialize(long version, String context, String key, String value, Long expiration)`
Returns an object recovered from a string produced through the `serialize(Type)` method.
`String`
`serialize(Type instance)`
Returns a string representing the input object.

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

## Method Details

### serialize

@Nonnull @NotEmpty String serialize(@Nonnull Type instance) throws IOException
Returns a string representing the input object.

Parameters:
  `instance` - object to serialize
Returns:
  a string
Throws:
  `IOException` - if an error occurs during serialization

### deserialize

@Nonnull Type deserialize(long version, @Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull @NotEmpty String value, @Nullable Long expiration) throws IOException
Returns an object recovered from a string produced through the `serialize(Type)` method.

Parameters:
  `version` - record version
  `context` - context of record
  `key` - key of record
  `value` - data to deserialize
  `expiration` - expiration of record, if any
Returns:
  a deserialized object
Throws:
  `IOException` - if an error occurs during deserialization