| AndBase开发框架 1.6

- 首页
- 相关页面
- 命名空间
- 类
- 文件

- 类列表
- 类索引
- 类继承关系
- 类成员

全部 类 命名空间 文件 函数 变量 枚举值 页
Public 成员函数 | 包函数 | 静态 Private 成员函数 | Private 属性 | 静态 Private 属性 | 所有成员列表
com.google.gson.JsonPrimitive类 参考
类 com.google.gson.JsonPrimitive 继承关系图:

## Public 成员函数
| JsonPrimitive (Boolean bool)
| JsonPrimitive (Number number)
| JsonPrimitive (String string)
| JsonPrimitive (Character c)
boolean | isBoolean ()
boolean | getAsBoolean ()
boolean | isNumber ()
Number | getAsNumber ()
boolean | isString ()
String | getAsString ()
double | getAsDouble ()
BigDecimal | getAsBigDecimal ()
BigInteger | getAsBigInteger ()
float | getAsFloat ()
long | getAsLong ()
short | getAsShort ()
int | getAsInt ()
byte | getAsByte ()
char | getAsCharacter ()
int | hashCode ()
boolean | equals (Object obj)
Public 成员函数 继承自 com.google.gson.JsonElement
boolean | isJsonArray ()
boolean | isJsonObject ()
boolean | isJsonPrimitive ()
boolean | isJsonNull ()
JsonObject | getAsJsonObject ()
JsonArray | getAsJsonArray ()
JsonPrimitive | getAsJsonPrimitive ()
JsonNull | getAsJsonNull ()
boolean | getAsBoolean ()
Number | getAsNumber ()
String | getAsString ()
double | getAsDouble ()
float | getAsFloat ()
long | getAsLong ()
int | getAsInt ()
byte | getAsByte ()
char | getAsCharacter ()
BigDecimal | getAsBigDecimal ()
BigInteger | getAsBigInteger ()
short | getAsShort ()
String | toString ()

## 包函数
| JsonPrimitive (Object primitive)
void | setValue (Object primitive)
Boolean | getAsBooleanWrapper ()
包函数 继承自 com.google.gson.JsonElement
Boolean | getAsBooleanWrapper ()

## 静态 Private 成员函数
static boolean | isPrimitiveOrString (Object target)
static boolean | isIntegral (JsonPrimitive primitive)

## Private 属性
Object | value

## 静态 Private 属性
static final Class<?>[] | PRIMITIVE_TYPES

## 详细描述

A class representing a Json primitive value. A primitive value is either a String, a Java primitive, or a Java primitive wrapper type.

作者
  Inderjeet Singh
  Joel Leitch

## 构造及析构函数说明

com.google.gson.JsonPrimitive.JsonPrimitive | ( | Boolean | bool | ) |
| inline

Create a primitive containing a boolean value.

参数

  bool | the value to create the primitive with.

com.google.gson.JsonPrimitive.JsonPrimitive | ( | Number | number | ) |
| inline

Create a primitive containing a Number.

参数

  number | the value to create the primitive with.

com.google.gson.JsonPrimitive.JsonPrimitive | ( | String | string | ) |
| inline

Create a primitive containing a String value.

参数

  string | the value to create the primitive with.

com.google.gson.JsonPrimitive.JsonPrimitive | ( | Character | c | ) |
| inline

Create a primitive containing a character. The character is turned into a one character String since Json only supports String.

参数

  c | the value to create the primitive with.

com.google.gson.JsonPrimitive.JsonPrimitive | ( | Object | primitive | ) |
| inline package

Create a primitive using the specified Object. It must be an instance of Number, a Java primitive type, or a String.

参数

  primitive | the value to create the primitive with.

## 成员函数说明

boolean com.google.gson.JsonPrimitive.equals | ( | Object | obj | ) |
| inline

BigDecimal com.google.gson.JsonPrimitive.getAsBigDecimal | ( |  | ) |
| inline

convenience method to get this element as a BigDecimal.

返回
  get this element as a BigDecimal.

异常

  NumberFormatException | if the value contained is not a valid BigDecimal.

BigInteger com.google.gson.JsonPrimitive.getAsBigInteger | ( |  | ) |
| inline

convenience method to get this element as a BigInteger.

返回
  get this element as a BigInteger.

异常

  NumberFormatException | if the value contained is not a valid BigInteger.

boolean com.google.gson.JsonPrimitive.getAsBoolean | ( |  | ) |
| inline

convenience method to get this element as a boolean value.

返回
  get this element as a primitive boolean value.

Boolean com.google.gson.JsonPrimitive.getAsBooleanWrapper | ( |  | ) |
| inline package

convenience method to get this element as a Boolean.

返回
  get this element as a Boolean.

byte com.google.gson.JsonPrimitive.getAsByte | ( |  | ) |
| inline

char com.google.gson.JsonPrimitive.getAsCharacter | ( |  | ) |
| inline

double com.google.gson.JsonPrimitive.getAsDouble | ( |  | ) |
| inline

convenience method to get this element as a primitive double.

返回
  get this element as a primitive double.

异常

  NumberFormatException | if the value contained is not a valid double.

float com.google.gson.JsonPrimitive.getAsFloat | ( |  | ) |
| inline

convenience method to get this element as a float.

返回
  get this element as a float.

异常

  NumberFormatException | if the value contained is not a valid float.

int com.google.gson.JsonPrimitive.getAsInt | ( |  | ) |
| inline

convenience method to get this element as a primitive integer.

返回
  get this element as a primitive integer.

异常

  NumberFormatException | if the value contained is not a valid integer.

long com.google.gson.JsonPrimitive.getAsLong | ( |  | ) |
| inline

convenience method to get this element as a primitive long.

返回
  get this element as a primitive long.

异常

  NumberFormatException | if the value contained is not a valid long.

Number com.google.gson.JsonPrimitive.getAsNumber | ( |  | ) |
| inline

convenience method to get this element as a Number.

返回
  get this element as a Number.

异常

  NumberFormatException | if the value contained is not a valid Number.

short com.google.gson.JsonPrimitive.getAsShort | ( |  | ) |
| inline

convenience method to get this element as a primitive short.

返回
  get this element as a primitive short.

异常

  NumberFormatException | if the value contained is not a valid short value.

String com.google.gson.JsonPrimitive.getAsString | ( |  | ) |
| inline

convenience method to get this element as a String.

返回
  get this element as a String.

int com.google.gson.JsonPrimitive.hashCode | ( |  | ) |
| inline

boolean com.google.gson.JsonPrimitive.isBoolean | ( |  | ) |
| inline

Check whether this primitive contains a boolean value.

返回
  true if this primitive contains a boolean value, false otherwise.

static boolean com.google.gson.JsonPrimitive.isIntegral | ( | JsonPrimitive | primitive | ) |
| inline static private

Returns true if the specified number is an integral type (Long, Integer, Short, Byte, BigInteger)

boolean com.google.gson.JsonPrimitive.isNumber | ( |  | ) |
| inline

Check whether this primitive contains a Number.

返回
  true if this primitive contains a Number, false otherwise.

static boolean com.google.gson.JsonPrimitive.isPrimitiveOrString | ( | Object | target | ) |
| inline static private

boolean com.google.gson.JsonPrimitive.isString | ( |  | ) |
| inline

Check whether this primitive contains a String value.

返回
  true if this primitive contains a String value, false otherwise.

void com.google.gson.JsonPrimitive.setValue | ( | Object | primitive | ) |
| inline package

## 类成员变量说明

final Class<?> [] com.google.gson.JsonPrimitive.PRIMITIVE_TYPES
| static private

初始值:
= { int.class, long.class, short.class,
float.class, double.class, byte.class, boolean.class, char.class, Integer.class, Long.class,
Short.class, Float.class, Double.class, Byte.class, Boolean.class, Character.class }

Object com.google.gson.JsonPrimitive.value
| private

该类的文档由以下文件生成:

- src/com/google/gson/JsonPrimitive.java