All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hydraql.shaded.fastjson2.writer.FieldWriterObjectFieldUF Maven / Gradle / Ivy

The newest version!
package hydraql.shaded.fastjson2.writer;

import hydraql.shaded.fastjson2.util.UnsafeUtils;

import java.lang.reflect.Field;
import java.lang.reflect.Type;

import static hydraql.shaded.fastjson2.util.UnsafeUtils.UNSAFE;

final class FieldWriterObjectFieldUF
        extends FieldWriterObjectField {
    final long fieldOffset;

    protected FieldWriterObjectFieldUF(
            String name,
            int ordinal,
            long features,
            String format,
            String label,
            Type fieldType,
            Class fieldClass,
            Field field
    ) {
        super(name, ordinal, features, format, label, fieldType, fieldClass, field);

        fieldOffset = UnsafeUtils.objectFieldOffset(field);
    }

    @Override
    public Object getFieldValue(Object object) {
        return UNSAFE.getObject(object, fieldOffset);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy