/******************************************************************************* | |
* Copyright (c) 2021 Contributors to the Eclipse Foundation | |
* | |
* See the NOTICE file(s) distributed with this work for additional | |
* information regarding copyright ownership. | |
* | |
* This program and the accompanying materials are made available under the | |
* terms of the Eclipse Public License v. 2.0 which is available at | |
* http://www.eclipse.org/legal/epl-2.0. | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
*******************************************************************************/ | |
package org.eclipse.mdm.api.base.massdata; | |
import org.eclipse.mdm.api.base.adapter.Core; | |
import org.eclipse.mdm.api.base.model.BaseEntity; | |
import org.eclipse.mdm.api.base.model.Deletable; | |
import org.eclipse.mdm.api.base.model.FileLink; | |
import org.eclipse.mdm.api.base.model.TypeSpecification; | |
/** | |
* {@link Entity} representing the ExternalComponent application element in the | |
* data storage. | |
* | |
* @author Matthias Koller, Peak Solution GmbH | |
* @author Martin Fleischer, Peak Solution GmbH | |
* | |
*/ | |
public class ExternalComponentEntity extends BaseEntity implements Deletable { | |
public static final String ATTR_ORDINALNUMBER = "OrdinalNumber"; | |
public static final String ATTR_TYPESPECIFICATION = "TypeSpecification"; | |
public static final String ATTR_LENGTH = "Length"; | |
public static final String ATTR_STARTOFFSET = "StartOffset"; | |
public static final String ATTR_BLOCKSIZE = "Blocksize"; | |
public static final String ATTR_VALUESPERBLOCK = "ValuesPerBlock"; | |
public static final String ATTR_VALUEOFFSET = "ValueOffset"; | |
public static final String ATTR_FILENAMEURL = "FilenameURL"; | |
public static final String ATTR_FLAGSFILENAMEURL = "FlagsFilenameURL"; | |
public static final String ATTR_FLAGSSTARTOFFSET = "FlagsStartOffset"; | |
public static final String ATTR_BITCOUNT = "BitCount"; | |
public static final String ATTR_BITOFFSET = "BitOffset"; | |
/** | |
* Constructor. | |
* | |
* @param core The {@link Core}. | |
*/ | |
public ExternalComponentEntity(Core core) { | |
super(core); | |
} | |
/** | |
* Sets the {@link TypeSpecification} for this instance. | |
* | |
* @param typeSpecification The {@link TypeSpecification} to set. | |
*/ | |
public void setTypeSpecification(TypeSpecification typeSpecification) { | |
getValue(ATTR_TYPESPECIFICATION).set(typeSpecification); | |
} | |
/** | |
* Sets the length for this instance. | |
* | |
* @param length The length to set. | |
*/ | |
public void setLength(int length) { | |
getValue(ATTR_LENGTH).set(length); | |
} | |
/** | |
* Sets the start offset for this instance. | |
* | |
* @param startOffset The start offset to set. | |
*/ | |
public void setStartOffset(long startOffset) { | |
getValue(ATTR_STARTOFFSET).set(startOffset); | |
} | |
/** | |
* Sets the block size for this instance. | |
* | |
* @param blocksize The block size to set. | |
*/ | |
public void setBlocksize(int blocksize) { | |
getValue(ATTR_BLOCKSIZE).set(blocksize); | |
} | |
/** | |
* Sets the values per block for this instance. | |
* | |
* @param valuesPerBlock The values per block to set. | |
*/ | |
public void setValuesPerBlock(int valuesPerBlock) { | |
getValue(ATTR_VALUESPERBLOCK).set(valuesPerBlock); | |
} | |
/** | |
* Sets the value offset for this instance. | |
* | |
* @param valueOffset The value offset to set. | |
*/ | |
public void setValueOffset(int valueOffset) { | |
getValue(ATTR_VALUEOFFSET).set(valueOffset); | |
} | |
/** | |
* Sets the values {@link FileLink} for this instance. | |
* | |
* @param fileLink The values {@link FileLink} to set. | |
*/ | |
public void setFileLink(FileLink fileLink) { | |
getValue(ATTR_FILENAMEURL).set(fileLink); | |
} | |
/** | |
* Sets the flags {@link FileLink} for this instance. | |
* | |
* @param flagsFileLink The flags {@link FileLink} to set. | |
*/ | |
public void setFlagsFileLink(FileLink flagsFileLink) { | |
getValue(ATTR_FLAGSFILENAMEURL).set(flagsFileLink); | |
} | |
/** | |
* Sets the flags start offset for this instance. | |
* | |
* @param flagsStartOffset The flags start offset to set. | |
*/ | |
public void setFlagsStartOffset(Long flagsStartOffset) { | |
getValue(ATTR_FLAGSSTARTOFFSET).set(flagsStartOffset); | |
} | |
/** | |
* Sets the ordinal number for this instance. | |
* | |
* @param ordinalNumber The ordinal number to set. | |
*/ | |
public void setOrdinalNumber(int ordinalNumber) { | |
getValue(ATTR_ORDINALNUMBER).set(ordinalNumber); | |
} | |
/** | |
* Sets the bit count for this instance. | |
* | |
* @param bitCount The bit count to set. | |
*/ | |
public void setBitCount(Short bitCount) { | |
getValue(ATTR_BITCOUNT).set(bitCount); | |
} | |
/** | |
* Sets the bit offset for this instance. | |
* | |
* @param bitOffset The bit offset to set. | |
*/ | |
public void setBitOffset(Short bitOffset) { | |
getValue(ATTR_BITOFFSET).set(bitOffset); | |
} | |
} |