Class EnumArrayCodec

java.lang.Object
org.dotwebstack.framework.backend.postgres.codec.EnumArrayCodec
All Implemented Interfaces:
io.r2dbc.postgresql.codec.Codec<String[]>

public class EnumArrayCodec extends Object implements io.r2dbc.postgresql.codec.Codec<String[]>
EnumArray R2DBC codec to represent an enum array as string array.

this implementation is based on io.r2dbc.postgresql.codec.AbstractArrayCodec

  • Field Details

  • Constructor Details

    • EnumArrayCodec

      public EnumArrayCodec(Set<Integer> dataTypes)
  • Method Details

    • canEncode

      public boolean canEncode(Object value)
      Specified by:
      canEncode in interface io.r2dbc.postgresql.codec.Codec<String[]>
    • canEncodeNull

      public boolean canEncodeNull(Class<?> type)
      Specified by:
      canEncodeNull in interface io.r2dbc.postgresql.codec.Codec<String[]>
    • decode

      public String[] decode(io.netty.buffer.ByteBuf buffer, int dataType, io.r2dbc.postgresql.message.Format format, Class<? extends String[]> type)
      Specified by:
      decode in interface io.r2dbc.postgresql.codec.Codec<String[]>
    • encode

      public io.r2dbc.postgresql.client.EncodedParameter encode(Object value)
      Specified by:
      encode in interface io.r2dbc.postgresql.codec.Codec<String[]>
    • encode

      public io.r2dbc.postgresql.client.EncodedParameter encode(Object o, int i)
      Specified by:
      encode in interface io.r2dbc.postgresql.codec.Codec<String[]>
    • encodeNull

      public io.r2dbc.postgresql.client.EncodedParameter encodeNull()
      Specified by:
      encodeNull in interface io.r2dbc.postgresql.codec.Codec<String[]>
    • canDecode

      public boolean canDecode(int dataType, io.r2dbc.postgresql.message.Format format, Class<?> type)
      Specified by:
      canDecode in interface io.r2dbc.postgresql.codec.Codec<String[]>