/** * Decodes a given String into a choice of the appropriate type. The String format to be passed * into this method is defined solely by the return result of the encodeChoice method. There is no * guarantee that the encoding is human readable, simply that the encoding is uniquely identifying * such that this method is capable of decoding the String into the choice object. * * @param persistentFormat The String which should be decoded to provide the choice of the * appropriate type. * @return A choice object of the appropriate type that was encoded in the given String. */ @Override public T decodeChoice(LoadContext context, String persistentFormat) { String choiceStr = persistentFormat; if (choiceActor instanceof CategorizedChooser) { return ((CategorizedChooser<T>) choiceActor).decodeChoice(choiceStr, category); } return choiceActor.decodeChoice(context, choiceStr); }
/** * Decodes a given String into a choice of the appropriate type. The String format to be passed * into this method is defined solely by the return result of the encodeChoice method. There is no * guarantee that the encoding is human readable, simply that the encoding is uniquely identifying * such that this method is capable of decoding the String into the choice object. * * @param persistenceFormat The String which should be decoded to provide the choice of the * appropriate type. * @return A choice object of the appropriate type that was encoded in the given String. */ @Override public T decodeChoice(LoadContext context, String persistenceFormat) { return choiceActor.decodeChoice(context, persistenceFormat); }