Get the value of the <code>id</code> field as String

@param object object containing the id. Must not be <code>null</code>
@return the value of the <code>id</code> field as String
165677
public static String getIdString(Object object) {
		if (object == null) {
			throw new NullPointerException();
		}
		return String.valueOf(getId(object));
	}
960541
public <FV> FV extractRawJavaFieldValue(Object object) throws SQLException {
		Object val;
		if (fieldGetMethod == null) {
			try {
				// field object may not be a T yet
				val = field.get(object);
			} catch (Exception e) {
				throw SqlExceptionUtil.create("Could not get field value for " + this, e);
			}
		} else {
			try {
				val = fieldGetMethod.invoke(object);
			} catch (Exception e) {
				throw SqlExceptionUtil.create("Could not call " + fieldGetMethod + " for " + this, e);
			}
		}

		@SuppressWarnings("unchecked")
		FV converted = (FV) val;
		return converted;
	}
954076
public static Object getValue(Field field, Object object) {
		String fieldName = field.getName();
		String setMethodName = "get" + firstLetterUpperCase(fieldName);
		Method method = null;
		try {
			method = object.getClass().getMethod(setMethodName);
		} catch (Exception e) {
		}
		
		if(method != null) {
			try {
				return method.invoke(object);
			} catch (Exception e) {
				LOGGER.error("method invoke", e);
			}
		}
		
		field.setAccessible(true);
		try {
			return field.get(object);
		} catch (Exception e) {
			LOGGER.error("method invoke", e);
			return null;
		}
	}
32535
public static <T extends Object> T getFieldValue(Object obj, String fieldName) {
        Assert.notNull(obj, "obj不能为空");
        Assert.notNull(fieldName, "fieldName不能为空");

        Field field;
        if (obj instanceof Class) {
            field = getField((Class) obj, fieldName);
        } else {
            field = getField(obj.getClass(), fieldName);
        }

        return getFieldValue(obj, field);
    }
448326
@Programmatic
    public String getId() {
        Object objectId = JDOHelper.getObjectId(this);
        if (objectId == null) {
            return "";
        }
        String objectIdStr = objectId.toString();
        final String id = objectIdStr.split("\\[OID\\]")[0];
        return id;
    }
239700
public static String display(Object object) {
        StringBuilder builder = new StringBuilder();
        displayRecursive(object, builder, new Stack<>(), false);
        return builder.toString();
    }
798364
public static final String defaultToString(Object object)
   {
      if (object == null)
         return "null";
      else
         return object.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(object));
   }
739703
public Object getValue(Object object) throws IllegalAccessException, InvocationTargetException {
        Object result = null;
        if (getter != null) {
            result = getter.invoke(object);
        } else if (field != null) {
            if(!field.isAccessible()){
                field.setAccessible(true);
            }
            result = field.get(object);
        }
        return result;
    }
180766
public String getString(int id)
	{
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "getString("+id+")");
		}
		
		return getter.getString(id);
	}
336947
public static String convertObjectToString(Object obj)
    {
        try {
            ByteArrayOutputStream writer = new ByteArrayOutputStream();
            ObjectOutputStream outStream = new ObjectOutputStream(writer);
            outStream.writeObject(obj);
            outStream.flush();
            writer.flush();
            String string = writer.toString(Constant.OBJECT_ENCODING);//Constants.STRING_ENCODING);
            writer.close();
            outStream.close();
            return string;
        } catch (IOException ex)    {
            ex.printStackTrace();   // Never
        }
        return null;
    }
111060
public String getObjectId(Object obj)
    {
        Identity oid = null;
        PersistenceBroker broker = null;

        try
        {
            if (getCurrentDatabase() != null)
            {
                /**
                 * is there an open database we are calling getObjectId against? if yes, use it
                 */
                broker = PersistenceBrokerFactory.createPersistenceBroker(getCurrentDatabase().getPBKey());
            }
            else
            {
                log.warn("Can't find open database, try to use the default configuration");
                /**
                 * otherwise, use default.
                 */
                broker = PersistenceBrokerFactory.defaultPersistenceBroker();
            }

            oid = broker.serviceIdentity().buildIdentity(obj);
        }
        finally
        {
            if(broker != null)
            {
                broker.close();
            }
        }
        return new String(SerializationUtils.serialize(oid));
    }
161992
public static Object getFieldValue(Object obj, String fieldName) throws UtilException {
		if (null == obj || StrUtil.isBlank(fieldName)) {
			return null;
		}
		return getFieldValue(obj, getField(obj.getClass(), fieldName));
	}
1263628
public static String[] getNames(Object object) {
		if (object == null) {
			return null;
		}
		Class<? extends Object> klass = object.getClass();
		Field[] fields = klass.getFields();
		int length = fields.length;
		if (length == 0) {
			return null;
		}
		String[] names = new String[length];
		for (int i = 0; i < length; i += 1) {
			names[i] = fields[i].getName();
		}
		return names;
	}
987879
public static Field getField(String fieldName, Object object) {
    return getField(fieldName, object.getClass());
  }
1204191
public Object getProperty(Object object) {
        return java.lang.reflect.Array.getLength(object);
    }
884932
public static Object[] getFieldsValue(Object obj) {
		if (null != obj) {
			final Field[] fields = getFields(obj.getClass());
			if (null != fields) {
				final Object[] values = new Object[fields.length];
				for (int i = 0; i < fields.length; i++) {
					values[i] = getFieldValue(obj, fields[i]);
				}
				return values;
			}
		}
		return null;
	}
568177
@Override
  public String asString(Object object)
  {
    // at this point object is guaranteed to be enumeration
    Enum<?> e = (Enum<?>)object;
    if(object instanceof OrdinalEnum) {
      return Integer.toString(e.ordinal());
    }
    return e.name();
  }