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

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

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

import java.util.List;

import com.google.gson.JsonArray;

public class MessagePluralCode extends MessageCode {

  private final List arguments;
  private final int offset;
  private final PluralNumberType pluralType;
  private final List choices;

  public MessagePluralCode(List arguments, int offset, PluralNumberType pluralType, List choices) {
    super(MessageOpType.PLURAL);
    this.arguments = arguments;
    this.offset = offset;
    this.pluralType = pluralType;
    this.choices = choices;
  }

  public List args() {
    return arguments;
  }

  public int offset() {
    return offset;
  }

  public PluralNumberType pluralType() {
    return pluralType;
  }

  public List choices() {
    return choices;
  }

  @Override
  protected void _toJson(JsonArray arr) {
    arr.add(arrayOf(arguments));
    arr.add(offset);
    arr.add(pluralType.value());
    arr.add(arrayOf(choices));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy