Interface DtoWriter

  • All Known Implementing Classes:
    JsonWriter

    public interface DtoWriter
    An object useful for writing DTO class instances to targets representing their contents with a specific encoding.
    • Method Detail

      • writeOne

        <T extends DtoWritable> void writeOne​(T value,
                                              BinaryWriter target)
                                       throws DtoWriteException
        Attempts to encode value and write it to target.
        Parameters:
        value - Object to encode and write to target.
        target - Receiver of encoded form of value.
        Throws:
        DtoWriteException - If writing to target fails.
        java.lang.NullPointerException - If value or target is null.
        java.lang.UnsupportedOperationException - If the DTO interface type of value does not support the encoding of this writer.
      • writeMany

        <T extends DtoWritable> void writeMany​(java.util.List<T> values,
                                               BinaryWriter target)
                                        throws DtoWriteException
        Attempts to encode values and write them to target.
        Parameters:
        values - Objects to encode and write to target.
        target - Receiver of encoded form of values.
        Throws:
        DtoWriteException - If writing to target fails.
        java.lang.NullPointerException - If values or target is null.
        java.lang.UnsupportedOperationException - If the DTO interface type of values does not support the encoding of this writer.