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

arez.persist.runtime.Converter Maven / Gradle / Ivy

There is a newer version: 0.48
Show newest version
package arez.persist.runtime;

import javax.annotation.Nonnull;

/**
 * Converter that encodes a persistent property from application form to encoded form and back again.
 *
 * @param  the application form of the value.
 * @param  the encoded form of the value.
 */
public interface Converter
{
  /**
   * Decode encoded value into form used by the application.
   *
   * @param encoded the encoded form of the value.
   * @return the value.
   */
  A decode( @Nonnull E encoded );

  /**
   * Encode value into form used by the storage system.
   *
   * @param value the decoded value.
   * @return the encoded form of the value.
   */
  E encode( @Nonnull A value );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy