Interface CompactWriter


  • public interface CompactWriter
    Provides means of writing compact serialized fields to the binary data.
    Since:
    5.2
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void writeArrayOfBoolean​(java.lang.String fieldName, boolean[] value)
      Writes an array of booleans.
      <T> void writeArrayOfCompact​(java.lang.String fieldName, T[] value)
      Writes an array of nested compact objects.
      void writeArrayOfDate​(java.lang.String fieldName, java.time.LocalDate[] value)
      Writes an array of dates consisting of year, month, and day.
      void writeArrayOfDecimal​(java.lang.String fieldName, java.math.BigDecimal[] value)
      Writes an array of arbitrary precision and scale floating point numbers.
      void writeArrayOfFloat32​(java.lang.String fieldName, float[] value)
      Writes an array of 32-bit IEEE 754 floating point numbers.
      void writeArrayOfFloat64​(java.lang.String fieldName, double[] value)
      Writes an array of 64-bit IEEE 754 floating point numbers.
      void writeArrayOfInt16​(java.lang.String fieldName, short[] value)
      Writes an array of 16-bit two's complement signed integers.
      void writeArrayOfInt32​(java.lang.String fieldName, int[] value)
      Writes an array of 32-bit two's complement signed integers.
      void writeArrayOfInt64​(java.lang.String fieldName, long[] value)
      Writes an array of 64-bit two's complement signed integers.
      void writeArrayOfInt8​(java.lang.String fieldName, byte[] value)
      Writes an array of 8-bit two's complement signed integers.
      void writeArrayOfNullableBoolean​(java.lang.String fieldName, java.lang.Boolean[] value)
      Writes a nullable array of nullable booleans.
      void writeArrayOfNullableFloat32​(java.lang.String fieldName, java.lang.Float[] value)
      Writes a nullable array of nullable 32-bit IEEE 754 floating point numbers.
      void writeArrayOfNullableFloat64​(java.lang.String fieldName, java.lang.Double[] value)
      Writes a nullable array of nullable 64-bit IEEE 754 floating point numbers.
      void writeArrayOfNullableInt16​(java.lang.String fieldName, java.lang.Short[] value)
      Writes a nullable array of nullable 16-bit two's complement signed integers.
      void writeArrayOfNullableInt32​(java.lang.String fieldName, java.lang.Integer[] value)
      Writes a nullable array of nullable 32-bit two's complement signed integers.
      void writeArrayOfNullableInt64​(java.lang.String fieldName, java.lang.Long[] value)
      Writes a nullable array of nullable 64-bit two's complement signed integers.
      void writeArrayOfNullableInt8​(java.lang.String fieldName, java.lang.Byte[] value)
      Writes a nullable array of nullable 8-bit two's complement signed integers.
      void writeArrayOfString​(java.lang.String fieldName, java.lang.String[] value)
      Writes an array of UTF-8 encoded strings.
      void writeArrayOfTime​(java.lang.String fieldName, java.time.LocalTime[] value)
      Writes an array of times consisting of hour, minute, second, and nano seconds.
      void writeArrayOfTimestamp​(java.lang.String fieldName, java.time.LocalDateTime[] value)
      Writes an array of timestamps consisting of date and time.
      void writeArrayOfTimestampWithTimezone​(java.lang.String fieldName, java.time.OffsetDateTime[] value)
      Writes an array of timestamps with timezone consisting of date, time and timezone offset.
      void writeBoolean​(java.lang.String fieldName, boolean value)
      Writes a boolean.
      <T> void writeCompact​(java.lang.String fieldName, T value)
      Writes a nested compact object.
      void writeDate​(java.lang.String fieldName, java.time.LocalDate value)
      Writes a date consisting of year, month, and day.
      void writeDecimal​(java.lang.String fieldName, java.math.BigDecimal value)
      Writes an arbitrary precision and scale floating point number.
      void writeFloat32​(java.lang.String fieldName, float value)
      Writes a 32-bit IEEE 754 floating point number.
      void writeFloat64​(java.lang.String fieldName, double value)
      Writes a 64-bit IEEE 754 floating point number.
      void writeInt16​(java.lang.String fieldName, short value)
      Writes a 16-bit two's complement signed integer.
      void writeInt32​(java.lang.String fieldName, int value)
      Writes a 32-bit two's complement signed integer.
      void writeInt64​(java.lang.String fieldName, long value)
      Writes a 64-bit two's complement signed integer.
      void writeInt8​(java.lang.String fieldName, byte value)
      Writes an 8-bit two's complement signed integer.
      void writeNullableBoolean​(java.lang.String fieldName, java.lang.Boolean value)
      Writes a nullable boolean.
      void writeNullableFloat32​(java.lang.String fieldName, java.lang.Float value)
      Writes a nullable 32-bit IEEE 754 floating point number.
      void writeNullableFloat64​(java.lang.String fieldName, java.lang.Double value)
      Writes a nullable 64-bit IEEE 754 floating point number.
      void writeNullableInt16​(java.lang.String fieldName, java.lang.Short value)
      Writes a nullable 16-bit two's complement signed integer.
      void writeNullableInt32​(java.lang.String fieldName, java.lang.Integer value)
      Writes a nullable 32-bit two's complement signed integer.
      void writeNullableInt64​(java.lang.String fieldName, java.lang.Long value)
      Writes a nullable 64-bit two's complement signed integer.
      void writeNullableInt8​(java.lang.String fieldName, java.lang.Byte value)
      Writes a nullable 8-bit two's complement signed integer.
      void writeString​(java.lang.String fieldName, java.lang.String value)
      Writes a UTF-8 encoded string.
      void writeTime​(java.lang.String fieldName, java.time.LocalTime value)
      Writes a time consisting of hour, minute, second, and nanoseconds.
      void writeTimestamp​(java.lang.String fieldName, java.time.LocalDateTime value)
      Writes a timestamp consisting of date and time.
      void writeTimestampWithTimezone​(java.lang.String fieldName, java.time.OffsetDateTime value)
      Writes a timestamp with timezone consisting of date, time and timezone offset.
    • Method Detail

      • writeBoolean

        void writeBoolean​(@Nonnull
                          java.lang.String fieldName,
                          boolean value)
        Writes a boolean.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeInt8

        void writeInt8​(@Nonnull
                       java.lang.String fieldName,
                       byte value)
        Writes an 8-bit two's complement signed integer.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeInt16

        void writeInt16​(@Nonnull
                        java.lang.String fieldName,
                        short value)
        Writes a 16-bit two's complement signed integer.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeInt32

        void writeInt32​(@Nonnull
                        java.lang.String fieldName,
                        int value)
        Writes a 32-bit two's complement signed integer.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeInt64

        void writeInt64​(@Nonnull
                        java.lang.String fieldName,
                        long value)
        Writes a 64-bit two's complement signed integer.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeFloat32

        void writeFloat32​(@Nonnull
                          java.lang.String fieldName,
                          float value)
        Writes a 32-bit IEEE 754 floating point number.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeFloat64

        void writeFloat64​(@Nonnull
                          java.lang.String fieldName,
                          double value)
        Writes a 64-bit IEEE 754 floating point number.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeString

        void writeString​(@Nonnull
                         java.lang.String fieldName,
                         @Nullable
                         java.lang.String value)
        Writes a UTF-8 encoded string.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeDecimal

        void writeDecimal​(@Nonnull
                          java.lang.String fieldName,
                          @Nullable
                          java.math.BigDecimal value)
        Writes an arbitrary precision and scale floating point number.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeTime

        void writeTime​(@Nonnull
                       java.lang.String fieldName,
                       @Nonnull
                       java.time.LocalTime value)
        Writes a time consisting of hour, minute, second, and nanoseconds.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeDate

        void writeDate​(@Nonnull
                       java.lang.String fieldName,
                       @Nonnull
                       java.time.LocalDate value)
        Writes a date consisting of year, month, and day.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeTimestamp

        void writeTimestamp​(@Nonnull
                            java.lang.String fieldName,
                            @Nonnull
                            java.time.LocalDateTime value)
        Writes a timestamp consisting of date and time.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeTimestampWithTimezone

        void writeTimestampWithTimezone​(@Nonnull
                                        java.lang.String fieldName,
                                        @Nonnull
                                        java.time.OffsetDateTime value)
        Writes a timestamp with timezone consisting of date, time and timezone offset.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeCompact

        <T> void writeCompact​(@Nonnull
                              java.lang.String fieldName,
                              @Nullable
                              T value)
        Writes a nested compact object.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfBoolean

        void writeArrayOfBoolean​(@Nonnull
                                 java.lang.String fieldName,
                                 @Nullable
                                 boolean[] value)
        Writes an array of booleans.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfInt8

        void writeArrayOfInt8​(@Nonnull
                              java.lang.String fieldName,
                              @Nullable
                              byte[] value)
        Writes an array of 8-bit two's complement signed integers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfInt16

        void writeArrayOfInt16​(@Nonnull
                               java.lang.String fieldName,
                               @Nullable
                               short[] value)
        Writes an array of 16-bit two's complement signed integers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfInt32

        void writeArrayOfInt32​(@Nonnull
                               java.lang.String fieldName,
                               @Nullable
                               int[] value)
        Writes an array of 32-bit two's complement signed integers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfInt64

        void writeArrayOfInt64​(@Nonnull
                               java.lang.String fieldName,
                               @Nullable
                               long[] value)
        Writes an array of 64-bit two's complement signed integers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfFloat32

        void writeArrayOfFloat32​(@Nonnull
                                 java.lang.String fieldName,
                                 @Nullable
                                 float[] value)
        Writes an array of 32-bit IEEE 754 floating point numbers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfFloat64

        void writeArrayOfFloat64​(@Nonnull
                                 java.lang.String fieldName,
                                 @Nullable
                                 double[] value)
        Writes an array of 64-bit IEEE 754 floating point numbers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfString

        void writeArrayOfString​(@Nonnull
                                java.lang.String fieldName,
                                @Nullable
                                java.lang.String[] value)
        Writes an array of UTF-8 encoded strings.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfDecimal

        void writeArrayOfDecimal​(@Nonnull
                                 java.lang.String fieldName,
                                 @Nullable
                                 java.math.BigDecimal[] value)
        Writes an array of arbitrary precision and scale floating point numbers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfTime

        void writeArrayOfTime​(@Nonnull
                              java.lang.String fieldName,
                              @Nullable
                              java.time.LocalTime[] value)
        Writes an array of times consisting of hour, minute, second, and nano seconds.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfDate

        void writeArrayOfDate​(@Nonnull
                              java.lang.String fieldName,
                              @Nullable
                              java.time.LocalDate[] value)
        Writes an array of dates consisting of year, month, and day.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfTimestamp

        void writeArrayOfTimestamp​(@Nonnull
                                   java.lang.String fieldName,
                                   @Nullable
                                   java.time.LocalDateTime[] value)
        Writes an array of timestamps consisting of date and time.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfTimestampWithTimezone

        void writeArrayOfTimestampWithTimezone​(@Nonnull
                                               java.lang.String fieldName,
                                               @Nullable
                                               java.time.OffsetDateTime[] value)
        Writes an array of timestamps with timezone consisting of date, time and timezone offset.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfCompact

        <T> void writeArrayOfCompact​(@Nonnull
                                     java.lang.String fieldName,
                                     @Nullable
                                     T[] value)
        Writes an array of nested compact objects.

        It is not allowed to write an array containing different item types or a HazelcastSerializationException will be thrown.

        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeNullableBoolean

        void writeNullableBoolean​(@Nonnull
                                  java.lang.String fieldName,
                                  @Nullable
                                  java.lang.Boolean value)
        Writes a nullable boolean.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeNullableInt8

        void writeNullableInt8​(@Nonnull
                               java.lang.String fieldName,
                               @Nullable
                               java.lang.Byte value)
        Writes a nullable 8-bit two's complement signed integer.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeNullableInt16

        void writeNullableInt16​(@Nonnull
                                java.lang.String fieldName,
                                @Nullable
                                java.lang.Short value)
        Writes a nullable 16-bit two's complement signed integer.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeNullableInt32

        void writeNullableInt32​(@Nonnull
                                java.lang.String fieldName,
                                @Nullable
                                java.lang.Integer value)
        Writes a nullable 32-bit two's complement signed integer.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeNullableInt64

        void writeNullableInt64​(@Nonnull
                                java.lang.String fieldName,
                                @Nullable
                                java.lang.Long value)
        Writes a nullable 64-bit two's complement signed integer.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeNullableFloat32

        void writeNullableFloat32​(@Nonnull
                                  java.lang.String fieldName,
                                  @Nullable
                                  java.lang.Float value)
        Writes a nullable 32-bit IEEE 754 floating point number.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeNullableFloat64

        void writeNullableFloat64​(@Nonnull
                                  java.lang.String fieldName,
                                  @Nullable
                                  java.lang.Double value)
        Writes a nullable 64-bit IEEE 754 floating point number.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfNullableBoolean

        void writeArrayOfNullableBoolean​(@Nonnull
                                         java.lang.String fieldName,
                                         @Nullable
                                         java.lang.Boolean[] value)
        Writes a nullable array of nullable booleans.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfNullableInt8

        void writeArrayOfNullableInt8​(@Nonnull
                                      java.lang.String fieldName,
                                      @Nullable
                                      java.lang.Byte[] value)
        Writes a nullable array of nullable 8-bit two's complement signed integers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfNullableInt16

        void writeArrayOfNullableInt16​(@Nonnull
                                       java.lang.String fieldName,
                                       @Nullable
                                       java.lang.Short[] value)
        Writes a nullable array of nullable 16-bit two's complement signed integers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfNullableInt32

        void writeArrayOfNullableInt32​(@Nonnull
                                       java.lang.String fieldName,
                                       @Nullable
                                       java.lang.Integer[] value)
        Writes a nullable array of nullable 32-bit two's complement signed integers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfNullableInt64

        void writeArrayOfNullableInt64​(@Nonnull
                                       java.lang.String fieldName,
                                       @Nullable
                                       java.lang.Long[] value)
        Writes a nullable array of nullable 64-bit two's complement signed integers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfNullableFloat32

        void writeArrayOfNullableFloat32​(@Nonnull
                                         java.lang.String fieldName,
                                         @Nullable
                                         java.lang.Float[] value)
        Writes a nullable array of nullable 32-bit IEEE 754 floating point numbers.
        Parameters:
        fieldName - name of the field.
        value - to be written.
      • writeArrayOfNullableFloat64

        void writeArrayOfNullableFloat64​(@Nonnull
                                         java.lang.String fieldName,
                                         @Nullable
                                         java.lang.Double[] value)
        Writes a nullable array of nullable 64-bit IEEE 754 floating point numbers.
        Parameters:
        fieldName - name of the field.
        value - to be written.