RecordBufferMeta { public T getField(String name) { return nameFieldMap.get(name); } private  RecordBufferMeta(Class<T> enumClass); @SuppressWarnings("unchecked") static RecordBufferMeta<T> getRecordOperator(Class<T> enumClass); T getField(String name); Class<T> getTableEnumClass(); String getTableName(); int getTableSize(); int getMaxHeaderLength(); List<T> getFieldList(); boolean hasSortedKey(); short getReferenceSectionLength(); boolean hasCollectionFieldInReferenceSection(); boolean hasNonCollectionFieldInReferenceSection(); byte getNumOfCollectionFieldInReferenceSection(); byte getNumOfNonCollectionFieldInReferenceSection(); int getSequenceOfCollectionField(int fieldId); int getCollectionSize(T col, RecordBuffer rb); int getCollectionSize(Field field, RecordBuffer rb); int getCollectionOffset(T col, RecordBuffer rb); int getCollectionOffset(Field field, RecordBuffer rb); int getFieldWithReferenceOffset(T col, RecordBuffer rb); int getFieldWithReferenceOffset(Field field, RecordBuffer rb); int getSortKeyOffset(RecordBuffer rb); static final Logger LOG; }
@Test public void getField() { RecordBufferMeta<MainTableMetadata> rbm = RecordBufferMeta.getRecordOperator(MainTableMetadata.class); Assert.assertEquals(MainTableMetadata.LONG_REQUIRED_COLUMN, rbm.getField("long_required_column")); Assert.assertEquals(null, rbm.getField("fake_user_id")); }