Interface EntityCodecDirect<T>

Type Parameters:
T -
All Known Subinterfaces:
EntityCodec<T>, EntityCodecDirectBase<T>, EntityCodecIndirectBase<T>, StringCodec, StringCodecDirectBase
All Known Implementing Classes:
EntityCodecAdapter, EntityCodecImpl, StringCodecPrefixAndSuffix, StringCodecQuote

public interface EntityCodecDirect<T>
The base interface for a view on a codecs which are based on encode(), decode() and canDecode() methods. Concrete implementations typically want to implicitly implement this interface by implementing EntityCodecDirectBase.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canDecode(T entity)
     
    decode(T entity)
     
    default T
    Convenience method that decodes the argument if possible and otherwise returns it as given
    encode(T entity)
     
  • Method Details

    • encode

      T encode(T entity)
    • canDecode

      boolean canDecode(T entity)
    • decode

      T decode(T entity)
    • decodeOrGetAsGiven

      default T decodeOrGetAsGiven(T entity)
      Convenience method that decodes the argument if possible and otherwise returns it as given