All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.squarespace.cldrengine.message.MessageBlockCode Maven / Gradle / Ivy

The newest version!
package com.squarespace.cldrengine.message;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.JsonArray;

public class MessageBlockCode extends MessageCode {

  private final List block;

  public MessageBlockCode() {
    this(new ArrayList<>());
  }

  public MessageBlockCode(List block) {
    super(MessageOpType.BLOCK);
    this.block = block;
  }

  public void add(MessageCode code) {
    this.block.add(code);
  }

  public List block() {
    return block;
  }

  @Override
  protected void _toJson(JsonArray arr) {
    JsonArray outer = new JsonArray();
    for (MessageCode code : block) {
      JsonArray _code = code.toJson();
      outer.add(_code);
    }
    arr.add(outer);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy