Skip to content

1.1.2 Cacheable

Anders Mikkelsen edited this page Dec 15, 2017 · 2 revisions

Cacheable Interface

This is a non-implement interface that creates a cache identifier, that is overrideable if you have a class define two separate logical components. i.e. a Comment class that doubles as a Reply.

public interface Cacheable {
    @DynamoDBIgnore
    @JsonIgnore
    default String getCachePartitionKey() {
        return getClass().getSimpleName();
    }
}
Clone this wiki locally