com.badlogic.gdx.utils.Json.convertToString()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中com.badlogic.gdx.utils.Json.convertToString()方法的一些代码示例,展示了Json.convertToString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Json.convertToString()方法的具体详情如下:
包路径:com.badlogic.gdx.utils.Json
类名称:Json
方法名:convertToString

Json.convertToString介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

private String convertToString (Object object) {
  if (object instanceof Enum) return convertToString((Enum)object);
  if (object instanceof Class) return ((Class)object).getName();
  return String.valueOf(object);
}

代码示例来源:origin: libgdx/libgdx

private String convertToString (Object object) {
  if (object instanceof Enum) return convertToString((Enum)object);
  if (object instanceof Class) return ((Class)object).getName();
  return String.valueOf(object);
}

代码示例来源:origin: libgdx/libgdx

writeObjectStart(actualType, knownType);
for (Entry entry : ((ObjectMap<?, ?>)value).entries()) {
  writer.name(convertToString(entry.key));
  writeValue(entry.value, elementType, null);
ArrayMap map = (ArrayMap)value;
for (int i = 0, n = map.size; i < n; i++) {
  writer.name(convertToString(map.keys[i]));
  writeValue(map.values[i], elementType, null);
writeObjectStart(actualType, knownType);
for (Map.Entry entry : ((Map<?, ?>)value).entrySet()) {
  writer.name(convertToString(entry.getKey()));
  writeValue(entry.getValue(), elementType, null);
  writer.value(convertToString((Enum)value));
  writeObjectEnd();
} else {
  writer.value(convertToString((Enum)value));

代码示例来源:origin: libgdx/libgdx

writeObjectStart(actualType, knownType);
for (Entry entry : ((ObjectMap<?, ?>)value).entries()) {
  writer.name(convertToString(entry.key));
  writeValue(entry.value, elementType, null);
ArrayMap map = (ArrayMap)value;
for (int i = 0, n = map.size; i < n; i++) {
  writer.name(convertToString(map.keys[i]));
  writeValue(map.values[i], elementType, null);
writeObjectStart(actualType, knownType);
for (Map.Entry entry : ((Map<?, ?>)value).entrySet()) {
  writer.name(convertToString(entry.getKey()));
  writeValue(entry.getValue(), elementType, null);
  writer.value(convertToString((Enum)value));
  writeObjectEnd();
} else {
  writer.value(convertToString((Enum)value));

代码示例来源:origin: libgdx/libgdx

for (int i = 0, n = constants.length; i < n; i++) {
  Enum e = constants[i];
  if (string.equals(convertToString(e))) return (T)e;

代码示例来源:origin: libgdx/libgdx

for (int i = 0, n = constants.length; i < n; i++) {
  Enum e = constants[i];
  if (string.equals(convertToString(e))) return (T)e;

代码示例来源:origin: com.badlogicgames.gdx/gdx

private String convertToString (Object object) {
  if (object instanceof Enum) return convertToString((Enum)object);
  if (object instanceof Class) return ((Class)object).getName();
  return String.valueOf(object);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

writeObjectStart(actualType, knownType);
for (Entry entry : ((ObjectMap<?, ?>)value).entries()) {
  writer.name(convertToString(entry.key));
  writeValue(entry.value, elementType, null);
ArrayMap map = (ArrayMap)value;
for (int i = 0, n = map.size; i < n; i++) {
  writer.name(convertToString(map.keys[i]));
  writeValue(map.values[i], elementType, null);
writeObjectStart(actualType, knownType);
for (Map.Entry entry : ((Map<?, ?>)value).entrySet()) {
  writer.name(convertToString(entry.getKey()));
  writeValue(entry.getValue(), elementType, null);
  writer.value(convertToString((Enum)value));
  writeObjectEnd();
} else {
  writer.value(convertToString((Enum)value));

代码示例来源:origin: com.badlogicgames.gdx/gdx

for (int i = 0, n = constants.length; i < n; i++) {
  Enum e = constants[i];
  if (string.equals(convertToString(e))) return (T)e;

相关文章