public Fixed32PackedWriters()

in foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/internal/schema/serializer/repeated/impl/ints/Fixed32PackedWriteSchemas.java [29:91]


    public Fixed32PackedWriters(Field protoField) {
      super(protoField);

      primitiveArrayWriter = (o, value) -> {
        if (value.length == 0) {
          return;
        }
        o.writeObject(tag, tagSize, value, (output, array) -> {
          for (int element : array) {
            output.writePackedFixed32(element);
          }
        });
      };

      arrayWriter = (o, value) -> {
        if (value.length == 0) {
          return;
        }
        o.writeObject(tag, tagSize, value, (output, array) -> {
          for (Integer element : array) {
            if (element != null) {
              output.writePackedFixed32(element);
              continue;
            }

            ProtoUtils.throwNotSupportNullElement(protoField);
          }
        });
      };

      collectionWriter = (o, value) -> {
        if (value.isEmpty()) {
          return;
        }
        o.writeObject(tag, tagSize, value, (output, collection) -> {
          for (Integer element : collection) {
            if (element != null) {
              output.writePackedFixed32(element);
              continue;
            }

            ProtoUtils.throwNotSupportNullElement(protoField);
          }
        });
      };

      stringArrayWriter = (o, value) -> {
        if (value.length == 0) {
          return;
        }
        o.writeObject(tag, tagSize, value, (output, array) -> {
          for (String element : array) {
            if (element != null) {
              int parsedValue = Integer.parseInt(element, 10);
              output.writePackedFixed32(parsedValue);
              continue;
            }

            ProtoUtils.throwNotSupportNullElement(protoField);
          }
        });
      };
    }