Package net.shibboleth.idp.consent.storage.impl

# Class CollectionSerializer

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.consent.storage.impl.CollectionSerializer

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `StorageSerializer<Collection<String>>`

public class CollectionSerializer extends AbstractInitializableComponent implements StorageSerializer<Collection<String>>
Serializes a `Collection` of strings. `Null` elements and non-string values are ignored.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final JsonGeneratorFactory`
`generatorFactory`
JSON generator factory.
`private final org.slf4j.Logger`
`log`
Class logger.
`private final JsonReaderFactory`
`readerFactory`
JSON reader factory.

## Constructor Summary

Constructors
Constructor
Description
`CollectionSerializer()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Collection<String>`
`deserialize(long version, String context, String key, String value, Long expiration)`
`String`
`serialize(Collection<String> instance)`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

`initialize, isInitialized`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### generatorFactory

@Nonnull private final JsonGeneratorFactory generatorFactory
JSON generator factory.

### readerFactory

@Nonnull private final JsonReaderFactory readerFactory
JSON reader factory.

## Constructor Details

### CollectionSerializer

public CollectionSerializer()
Constructor.

## Method Details

### serialize

@Nonnull @NotEmpty public String serialize(@Nonnull Collection<String> instance) throws IOException

Specified by:
  `serialize` in interface `StorageSerializer<Collection<String>>`
Throws:
  `IOException`

### deserialize

@Nonnull public Collection<String> deserialize(long version, @Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull @NotEmpty String value, @Nullable Long expiration) throws IOException

Specified by:
  `deserialize` in interface `StorageSerializer<Collection<String>>`
Throws:
  `IOException`