Package org.openmuc.jeebus.spine.impl
Class DataIdDescription<DATA>
- java.lang.Object
-
- org.openmuc.jeebus.spine.impl.DataIdDescription<DATA>
-
public class DataIdDescription<DATA> extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataIdDescription.IdValidationStatus
-
Constructor Summary
Constructors Constructor Description DataIdDescription(java.lang.Class<DATA> dataType, java.util.List<java.lang.String> idNames)Defines the names of the attributes that uniquely identify data objects from a Feature Function data list (SPINE protocol spec 5.3.4.6) and stores thePropertyDescriptors for each attribute.DataIdDescription(java.lang.Class<DATA> dataType, java.util.List<java.lang.String> idNames, java.util.List<java.lang.String> optionalSubIdNames)Defines the names of the attributes that uniquely identify data objects from a Feature Function data list (SPINE protocol spec 5.3.4.6) and optional sub identifiers that may be used to sub identify a FeatureFunction and stores thePropertyDescriptors for each attribute.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandataMatchesForIdDescription(DATA writable, DATA update)Checks if the ids of writable match the ids of update.java.util.List<java.beans.PropertyDescriptor>getAllIdPropertyDescriptors()java.lang.Class<DATA>getDataType()java.util.List<java.beans.PropertyDescriptor>getIdAttributePropertyDescriptors()static <D> DataIdDescription<D>getNoneIdentifiableDataDescription(java.lang.Class<D> dataType)java.util.List<java.beans.PropertyDescriptor>getOptionalSubIdAttributePropertyDescriptors()DataIdDescription.IdValidationStatusvalidateData(DATA data)Validates if given data is valid for this id description.
-
-
-
Constructor Detail
-
DataIdDescription
public DataIdDescription(java.lang.Class<DATA> dataType, java.util.List<java.lang.String> idNames)
Defines the names of the attributes that uniquely identify data objects from a Feature Function data list (SPINE protocol spec 5.3.4.6) and stores thePropertyDescriptors for each attribute.- Parameters:
dataType- type of the dataidNames- list of mandatory primary and sub ids
-
DataIdDescription
public DataIdDescription(java.lang.Class<DATA> dataType, java.util.List<java.lang.String> idNames, java.util.List<java.lang.String> optionalSubIdNames)
Defines the names of the attributes that uniquely identify data objects from a Feature Function data list (SPINE protocol spec 5.3.4.6) and optional sub identifiers that may be used to sub identify a FeatureFunction and stores thePropertyDescriptors for each attribute. TODO add Foreign Identifier- Parameters:
dataType- type of the dataidNames- list of mandatory primary and sub idsoptionalSubIdNames- list of sub ids that are optional
-
-
Method Detail
-
getIdAttributePropertyDescriptors
public java.util.List<java.beans.PropertyDescriptor> getIdAttributePropertyDescriptors()
-
getOptionalSubIdAttributePropertyDescriptors
public java.util.List<java.beans.PropertyDescriptor> getOptionalSubIdAttributePropertyDescriptors()
-
getAllIdPropertyDescriptors
public java.util.List<java.beans.PropertyDescriptor> getAllIdPropertyDescriptors()
-
getDataType
public java.lang.Class<DATA> getDataType()
-
getNoneIdentifiableDataDescription
public static <D> DataIdDescription<D> getNoneIdentifiableDataDescription(java.lang.Class<D> dataType)
-
validateData
public DataIdDescription.IdValidationStatus validateData(DATA data)
Validates if given data is valid for this id description.- Return
DataIdDescription.IdValidationStatus.VALID_ID: all mandatory ids are set and any number of optional sub ids are set - Return
DataIdDescription.IdValidationStatus.IDS_NULL: all mandatory and optional sub ids are null - Return
DataIdDescription.IdValidationStatus.INVALID: not all mandatory ids are set and not all ids are null
- Parameters:
data- data to validate- Returns:
- if given data is valid for this id description.
- Return
-
dataMatchesForIdDescription
public boolean dataMatchesForIdDescription(DATA writable, DATA update)
Checks if the ids of writable match the ids of update. This also returns true in any case if all ids of update are null.- Parameters:
writable- the writableupdate- the update for the writable- Returns:
- if the ids of writable match or all ids of update or ids of update are all null
-
-