Package org.apache.avro.message

# Class SchemaStore.Cache

java.lang.Object
org.apache.avro.message.SchemaStore.Cache

All Implemented Interfaces:
  `SchemaStore`

Enclosing interface:
  `SchemaStore`

public static class SchemaStore.Cache extends Object implements SchemaStore
A map-based cache of schemas by AVRO-CRC-64 fingerprint.

This class is thread-safe.

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.apache.avro.message.SchemaStore

`SchemaStore.Cache`

## Constructor Summary

Constructors
Constructor
Description
`Cache()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addSchema(Schema schema)`
Adds a schema to this cache that can be retrieved using its AVRO-CRC-64 fingerprint.
`Schema`
`findByFingerprint(long fingerprint)`
Retrieves a fingerprint by its AVRO-CRC-64 fingerprint.

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

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

## Constructor Details

### Cache

public Cache()

## Method Details

### addSchema

public void addSchema(Schema schema)
Adds a schema to this cache that can be retrieved using its AVRO-CRC-64 fingerprint.

Parameters:
  `schema` - a `Schema`

### findByFingerprint

public Schema findByFingerprint(long fingerprint)
Description copied from interface: `SchemaStore`
Retrieves a fingerprint by its AVRO-CRC-64 fingerprint.

Specified by:
  `findByFingerprint` in interface `SchemaStore`
Parameters:
  `fingerprint` - an AVRO-CRC-64 fingerprint long
Returns:
  a Schema with the given fingerprint, or null