Class

scalacache.arcus

ReplaceAndTruncateSanitizer

Related Doc: package arcus

Permalink

case class ReplaceAndTruncateSanitizer(replacementChar: String = "_", maxKeyLength: Int = 250) extends MemcachedKeySanitizer with Product with Serializable

Sanitizer that replaces characters invalid for Memcached and truncates keys if they are over a certain limit.

Convenient because it creates human-readable keys, but only safe for ASCII chars.

replacementChar

optional, defaults to an underscore

maxKeyLength

optional, defaults to 250, which is the max length of a Memcached key

Linear Supertypes
Serializable, Serializable, Product, Equals, MemcachedKeySanitizer, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReplaceAndTruncateSanitizer
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. MemcachedKeySanitizer
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ReplaceAndTruncateSanitizer(replacementChar: String = "_", maxKeyLength: Int = 250)

    Permalink

    replacementChar

    optional, defaults to an underscore

    maxKeyLength

    optional, defaults to 250, which is the max length of a Memcached key

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  8. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  9. val invalidCharsRegex: Regex

    Permalink
  10. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  11. val maxKeyLength: Int

    Permalink

    optional, defaults to 250, which is the max length of a Memcached key

  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. val replacementChar: String

    Permalink

    optional, defaults to an underscore

  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toValidMemcachedKey(key: String): String

    Permalink

    Convert the given string to a valid Memcached key by:

    Convert the given string to a valid Memcached key by:

    • replacing all invalid characters with underscores
    • truncating the string to 250 characters

    From the Memcached protocol spec:

    Data stored by memcached is identified with the help of a key. A key is a text string which should uniquely identify the data for clients that are interested in storing and retrieving it. Currently the length limit of a key is set at 250 characters (of course, normally clients wouldn't need to use such long keys); the key must not include control characters or whitespace.

    Because of the structure of cache keys, the most useful information is likely to be at the right hand end, so truncation is performed from the left.

    Definition Classes
    ReplaceAndTruncateSanitizerMemcachedKeySanitizer
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from MemcachedKeySanitizer

Inherited from AnyRef

Inherited from Any

Ungrouped