All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.octo.android.robospice.persistence.keysanitation.KeySanitizer Maven / Gradle / Ivy

The newest version!
package com.octo.android.robospice.persistence.keysanitation;

import com.octo.android.robospice.persistence.exception.KeySanitationExcepion;

/**
 * Describes the behavior of an entity responsible for sanitizing keys.
 * Basically, it will take a cache key and encrypt/decrypt to/from a string that
 * can be safely used to create a cache entry.
 * 

* For instance, it can take a cache key like '/foo%1' and convert it to some * key that can be used to create a cache file's name on a file system. *

* The operation proposed by a {@link KeySanitizer} must be bijective. * @author SNI */ public interface KeySanitizer { /** * Will sanitize a given cache key. * @param cacheKey * the cache key to sanitize. * @return the sanitized cache key. */ Object sanitizeKey(Object cacheKey) throws KeySanitationExcepion; /** * Will de-sanitize a given sanitized cache key. * @param sanitizedCacheKey * the cache key to de-sanitize. * @return the de-sanitized cache key. */ Object desanitizeKey(Object sanitizedCacheKey) throws KeySanitationExcepion; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy