// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import dk.vajhoej.isam.KeyField;
import dk.vajhoej.record.Alignment;
import dk.vajhoej.record.Endian;
import dk.vajhoej.record.FieldType;
import dk.vajhoej.record.Selector;
import dk.vajhoej.record.Struct;
import dk.vajhoej.record.StructField;
import dk.vajhoej.record.SubType;

@Struct(endianess=Endian.LITTLE, alignment=Alignment.ALIGN1)
public class AssetISAM {
    @KeyField(n=0)
    @StructField(n=0, type=FieldType.INT4)
    private int id;
    @StructField(n=1, type=FieldType.FIXSTR, length=32)
    private String description;
    @StructField(n=2, type=FieldType.INT4)
    @Selector(subtypes={@SubType(value=1,type=TruckAssetISAM.class),
                        @SubType(value=2,type=TrailerAssetISAM.class),
                        @SubType(value=3,type=ToolAssetISAM.class)})
    private int assetType;
    public AssetISAM() {
        this(0, "", 0);
    }
    public AssetISAM(int id, String description, int assetType) {
        this.id = id;
        this.description = description;
        this.assetType = assetType;
    }
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public int getAssetType() {
        return assetType;
    }
    public void setAssetType(int assetType) {
        this.assetType = assetType;
    }
}
