Class StringTranslatorFactory

java.lang.Object
com.googlecode.objectify.impl.translate.ValueTranslatorFactory<String,​Object>
com.googlecode.objectify.impl.translate.StringTranslatorFactory
All Implemented Interfaces:
TranslatorFactory<String,​Object>

public class StringTranslatorFactory
extends ValueTranslatorFactory<String,​Object>
Knows how to convert Strings. Datastore representation might be String or it might be Text. Will work with anything that's in the datastore just by calling toString() on what we get back; convenient for converting between say Number and the String representation, possibly dangerous otherwise.
  • Field Details

    • MAX_STRING_BYTES

      public static final int MAX_STRING_BYTES
      Maximum number of BYTES we can store in a String before we have to convert to Text.
      See Also:
      Constant Field Values
    • SAFE_STRING_CHARS

      public static final int SAFE_STRING_CHARS
      Google isn't explicit that UTF-8 encoding is used, but it's a safe assumption. Worst case is 4 bytes per character. So if we have more than that number of chars, we have to convert to UTF-8 to test the actual length.
      See Also:
      Constant Field Values
  • Constructor Details

    • StringTranslatorFactory

      public StringTranslatorFactory()
  • Method Details