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

com.squarespace.cldrengine.api.NumberFormatOptions Maven / Gradle / Ivy

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

import lombok.Generated;
import lombok.EqualsAndHashCode;

@Generated
@EqualsAndHashCode(callSuper = true)
public class NumberFormatOptions extends DecimalAdjustOptions {

  public final Option group = Option.option();
  public final Option numberSystem = Option.option();
  public final Option trimZeroFractions = Option.option();

  public NumberFormatOptions() {
  }

  public NumberFormatOptions(NumberFormatOptions arg) {
    super(arg);
    this.group.set(arg.group);
    this.numberSystem.set(arg.numberSystem);
    this.trimZeroFractions.set(arg.trimZeroFractions);
  }

  public NumberFormatOptions group(Boolean arg) {
    this.group.set(arg);
    return this;
  }

  public NumberFormatOptions group(Option arg) {
    this.group.set(arg);
    return this;
  }

  public NumberFormatOptions numberSystem(String arg) {
    this.numberSystem.set(arg);
    return this;
  }

  public NumberFormatOptions numberSystem(Option arg) {
    this.numberSystem.set(arg);
    return this;
  }

  public NumberFormatOptions trimZeroFractions(Boolean arg) {
    this.trimZeroFractions.set(arg);
    return this;
  }

  public NumberFormatOptions trimZeroFractions(Option arg) {
    this.trimZeroFractions.set(arg);
    return this;
  }

  public static NumberFormatOptions fromSuper(DecimalAdjustOptions arg) {
    NumberFormatOptions o = NumberFormatOptions.build();
    o.round.setIf(arg.round);
    o.minimumIntegerDigits.setIf(arg.minimumIntegerDigits);
    o.maximumFractionDigits.setIf(arg.maximumFractionDigits);
    o.minimumFractionDigits.setIf(arg.minimumFractionDigits);
    o.maximumSignificantDigits.setIf(arg.maximumSignificantDigits);
    o.minimumSignificantDigits.setIf(arg.minimumSignificantDigits);
    return o;
  }

  public NumberFormatOptions round(RoundingModeType arg) {
    this.round.set(arg);
    return this;
  }

  public NumberFormatOptions round(Option arg) {
    this.round.set(arg);
    return this;
  }

  public NumberFormatOptions minimumIntegerDigits(Integer arg) {
    this.minimumIntegerDigits.set(arg);
    return this;
  }

  public NumberFormatOptions minimumIntegerDigits(Option arg) {
    this.minimumIntegerDigits.set(arg);
    return this;
  }

  public NumberFormatOptions maximumFractionDigits(Integer arg) {
    this.maximumFractionDigits.set(arg);
    return this;
  }

  public NumberFormatOptions maximumFractionDigits(Option arg) {
    this.maximumFractionDigits.set(arg);
    return this;
  }

  public NumberFormatOptions minimumFractionDigits(Integer arg) {
    this.minimumFractionDigits.set(arg);
    return this;
  }

  public NumberFormatOptions minimumFractionDigits(Option arg) {
    this.minimumFractionDigits.set(arg);
    return this;
  }

  public NumberFormatOptions maximumSignificantDigits(Integer arg) {
    this.maximumSignificantDigits.set(arg);
    return this;
  }

  public NumberFormatOptions maximumSignificantDigits(Option arg) {
    this.maximumSignificantDigits.set(arg);
    return this;
  }

  public NumberFormatOptions minimumSignificantDigits(Integer arg) {
    this.minimumSignificantDigits.set(arg);
    return this;
  }

  public NumberFormatOptions minimumSignificantDigits(Option arg) {
    this.minimumSignificantDigits.set(arg);
    return this;
  }

  public static NumberFormatOptions build() {
    return new NumberFormatOptions();
  }

  public NumberFormatOptions copy() {
    return new NumberFormatOptions(this);
  }

  public NumberFormatOptions mergeIf(NumberFormatOptions ...args) {
    NumberFormatOptions o = new NumberFormatOptions(this);
    for (NumberFormatOptions arg : args) {
      o._mergeIf(arg);
    }
    return o;
  }

  protected void _mergeIf(NumberFormatOptions o) {
    super._mergeIf(o);
    this.group.setIf(o.group);
    this.numberSystem.setIf(o.numberSystem);
    this.trimZeroFractions.setIf(o.trimZeroFractions);
  }

  public NumberFormatOptions merge(NumberFormatOptions ...args) {
    NumberFormatOptions o = new NumberFormatOptions(this);
    for (NumberFormatOptions arg : args) {
      o._merge(arg);
    }
    return o;
  }

  protected void _merge(NumberFormatOptions o) {
    super._merge(o);
    this.group.set(o.group);
    this.numberSystem.set(o.numberSystem);
    this.trimZeroFractions.set(o.trimZeroFractions);
  }


  @Override
  public String toString() {
    StringBuilder buf = new StringBuilder("NumberFormatOptions( ");
    this._tostring(buf);
    return buf.append(')').toString();
  }

  protected void _tostring(StringBuilder buf) {
    super._tostring(buf);
    if (group.ok()) {
      buf.append("group=").append(group).append(' ');
    }
    if (numberSystem.ok()) {
      buf.append("numberSystem=").append(numberSystem).append(' ');
    }
    if (trimZeroFractions.ok()) {
      buf.append("trimZeroFractions=").append(trimZeroFractions).append(' ');
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy