コード例 #1
0
 /**
  * Create a primitive using the specified Object. It must be an instance of {@link Number}, a Java
  * primitive type, or a String.
  *
  * @param primitive the value to create the primitive with.
  */
 JsonPrimitive(Object primitive) {
   setValue(primitive);
 }
コード例 #2
0
 /**
  * Create a primitive containing a character. The character is turned into a one character String
  * since Json only supports String.
  *
  * @param c the value to create the primitive with.
  */
 public JsonPrimitive(Character c) {
   setValue(c);
 }
コード例 #3
0
 /**
  * Create a primitive containing a {@link Number}.
  *
  * @param number the value to create the primitive with.
  */
 public JsonPrimitive(Number number) {
   setValue(number);
 }
コード例 #4
0
 /**
  * Create a primitive containing a String value.
  *
  * @param string the value to create the primitive with.
  */
 public JsonPrimitive(String string) {
   setValue(string);
 }
コード例 #5
0
 /**
  * Create a primitive containing a boolean value.
  *
  * @param bool the value to create the primitive with.
  */
 public JsonPrimitive(Boolean bool) {
   setValue(bool);
 }