@Test public void testPropertyValues() { assertEquals(Arrays.asList("san diego", "startTime", year(2000)), values(location)); assertEquals(Arrays.asList("since", year(2000)), values(develops)); }
@SneakyThrows @SuppressWarnings("unchecked") public static List<Object> values(Object object) { List<Object> properties = new ArrayList<>(); Class<?> objectClass = object.getClass(); if (isPrimitive(objectClass)) { properties.add(object); } else if (isElement(objectClass)) { for (Field field : fields((Class<? extends Element>) objectClass)) { Object value = propertyValue(field, object); if (isMissing(value)) { continue; } String propertyName = propertyKey(field); if (isPropertyValue(field)) { properties.add(0, value); } else { properties.add(propertyName); properties.add(value); } } } return properties; }
Properties { @SneakyThrows @SuppressWarnings("unchecked") public static List<Object> values(Object object) { List<Object> properties = new ArrayList<>(); Class<?> objectClass = object.getClass(); if (isPrimitive(objectClass)) { properties.add(object); } else if (isElement(objectClass)) { for (Field field : fields((Class<? extends Element>) objectClass)) { Object value = propertyValue(field, object); if (isMissing(value)) { continue; } String propertyName = propertyKey(field); if (isPropertyValue(field)) { properties.add(0, value); } else { properties.add(propertyName); properties.add(value); } } } return properties; } }
Properties { @SneakyThrows @SuppressWarnings("unchecked") public static List<Object> values(Object object) { List<Object> properties = new ArrayList<>(); Class<?> objectClass = object.getClass(); if (isPrimitive(objectClass)) { properties.add(object); } else if (isElement(objectClass)) { for (Field field : fields((Class<? extends Element>) objectClass)) { Object value = propertyValue(field, object); if (isMissing(value)) { continue; } String propertyName = propertyKey(field); if (isPropertyValue(field)) { properties.add(0, value); } else { properties.add(propertyName); properties.add(value); } } } return properties; } private  Properties(); }
Properties { @SneakyThrows @SuppressWarnings("unchecked") public static List<Object> values(Object object) { List<Object> properties = new ArrayList<>(); Class<?> objectClass = object.getClass(); if (isPrimitive(objectClass)) { properties.add(object); } else if (isElement(objectClass)) { for (Field field : fields((Class<? extends Element>) objectClass)) { Object value = propertyValue(field, object); if (isMissing(value)) { continue; } String propertyName = propertyKey(field); if (isPropertyValue(field)) { properties.add(0, value); } else { properties.add(propertyName); properties.add(value); } } } return properties; } private  Properties(); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] id(E element); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] all(E element); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] all(E element, Predicate<Field> predicate, T... ts); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] of(V vertex); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] of(E edge); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] of(E element, Predicate<Field> predicate); static Object[] simple(E element, T... ts); static Object[] complex(E element); @SneakyThrows static List<Object> some(E element, Predicate<Field> predicate); static List<String> names(E element); static List<String> names(E element, Predicate<Field> predicate); @SneakyThrows @SuppressWarnings("unchecked") static List<Object> values(Object object); static List<Property> list(Object... objects); @SneakyThrows static List<String> nullKeys(E element); @SneakyThrows static List<String> listKeys(E element); }
Properties { @SneakyThrows @SuppressWarnings("unchecked") public static List<Object> values(Object object) { List<Object> properties = new ArrayList<>(); Class<?> objectClass = object.getClass(); if (isPrimitive(objectClass)) { properties.add(object); } else if (isElement(objectClass)) { for (Field field : fields((Class<? extends Element>) objectClass)) { Object value = propertyValue(field, object); if (isMissing(value)) { continue; } String propertyName = propertyKey(field); if (isPropertyValue(field)) { properties.add(0, value); } else { properties.add(propertyName); properties.add(value); } } } return properties; } private  Properties(); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] id(E element); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] all(E element); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] all(E element, Predicate<Field> predicate, T... ts); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] of(V vertex); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] of(E edge); @SuppressWarnings({"PMD.ShortMethodName"}) static Object[] of(E element, Predicate<Field> predicate); static Object[] simple(E element, T... ts); static Object[] complex(E element); @SneakyThrows static List<Object> some(E element, Predicate<Field> predicate); static List<String> names(E element); static List<String> names(E element, Predicate<Field> predicate); @SneakyThrows @SuppressWarnings("unchecked") static List<Object> values(Object object); static List<Property> list(Object... objects); @SneakyThrows static List<String> nullKeys(E element); @SneakyThrows static List<String> listKeys(E element);  }