001package com.identityworksllc.iiq.common;
002
003import java.util.Map;
004
005/**
006 * An interface that can be implemented by any object that would like to translate
007 * itself from a Map input. This is intended for use by the ObjectMapper utility, but
008 * may be used outside of that function.
009 *
010 * This is, roughly, the opposite of {@link Mappable} without the automation.
011 */
012@FunctionalInterface
013public interface MapDecodable {
014
015    /**
016     * Initializes this object from a Map
017     * @param input The input map
018     * @throws ObjectMapper.ObjectMapperException if the mapping operation fails
019     */
020    void initializeFromMap(Map<String, Object> input) throws ObjectMapper.ObjectMapperException;
021}