本文整理了Java中com.badlogic.gdx.utils.Json.convertToString()
方法的一些代码示例,展示了Json.convertToString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Json.convertToString()
方法的具体详情如下:
包路径:com.badlogic.gdx.utils.Json
类名称: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;
内容来源于网络,如有侵权,请联系作者删除!