List of usage examples for java.lang.reflect AccessibleObject getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.mylife.hbase.mapper.HBaseEntityMapper.java
private byte[] getRowKeyFrom(final Object hbasePersistableObject) throws Exception { /*/*from www . j ava 2 s .c o m*/ * Get the field or method that has the @HBaseRowKey annotation. */ AccessibleObject accessibleObject = annotatedClassToAnnotatedHBaseRowKey .get(hbasePersistableObject.getClass()); accessibleObject.setAccessible(true); /* * Either invoke a method to get the key value from the overall hbasePersistableObject or simple field value. */ if (accessibleObject.getClass().isAssignableFrom(Method.class)) { return toBytes(((Method) accessibleObject).invoke(hbasePersistableObject, (Object[]) null)); } else { return toBytes(((Field) accessibleObject).get(hbasePersistableObject)); } }