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

tech.simter.data.Option Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package tech.simter.data;

/**
 * An option for simple text/value holder. It's similar to 'HTML DOM Option' object.
 *
 * @author RJ
 */
public class Option {
  /**
   * The text.
   */
  public String text;
  /**
   * The value.
   */
  public String value;

  public Option() {
  }

  /**
   * Instance with only text. This also set value equals to text.
   *
   * @param text the text
   */
  public Option(String text) {
    this.text = text;
    this.value = text;
  }

  /**
   * Instance with text and value.
   *
   * @param text  the text
   * @param value the value
   */
  public Option(String text, String value) {
    this.text = text;
    this.value = value;
  }

  /**
   * Instance with text and value.
   *
   * @param text  the text
   * @param value the number value
   */
  public Option(String text, Number value) {
    this.text = text;
    this.value = value == null ? null : value.toString();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy