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

com.github.bloodshura.ignitium.ntv.struct.ForeignStructField Maven / Gradle / Ivy

The newest version!
package com.github.bloodshura.ignitium.ntv.struct;

import javax.annotation.Nonnull;
import java.util.function.Supplier;

public class ForeignStructField extends StructField {
	private final Supplier generator;

	public ForeignStructField(@Nonnull MappedStruct struct, int offset, int size, @Nonnull Supplier generator) {
		super(struct, offset, size);
		this.generator = generator;
	}

	@Nonnull
	@Override
	protected E read() {
		E instance = generator.get();

		instance.map(getStruct().getSource(), getOffset());

		return instance;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy