Class Variable
java.lang.Object
eu.dzhw.fdz.metadatamanagement.common.domain.AbstractRdcDomainObject
eu.dzhw.fdz.metadatamanagement.common.domain.AbstractShadowableRdcDomainObject
eu.dzhw.fdz.metadatamanagement.variablemanagement.domain.Variable
- All Implemented Interfaces:
Serializable
@CompoundIndex(def="{name: 1, dataSetId: 1}",unique=true) @CompoundIndex(def="{indexInDataSet: 1, dataSetId: 1}",unique=false)
@ValidShadowId(message="variable-management.error.variable.id.pattern")
@ValidVariableIdName(message="variable-management.error.variable.valid-variable-name")
@ValidRepeatedMeasurementIdentifier(message="variable-management.error.variable.valid-repeated-measurement-identifier")
@ValidDerivedVariablesIdentifier(message="variable-management.error.variable.valid-derived-variables-identifier")
@UniqueVariableNameInDataSet(message="variable-management.error.variable.unique-variable-name-in-data-set")
@RestrictedScaleLevelForDateDataType(message="variable-management.error.variable.restricted-scale-level-for-date-data-type")
@ValidResponseValueMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.valid-response-value-must-be-an-iso-date-on-date-data-type")
@StatisticsMinimumMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-minimum-must-be-an-iso-date-on-date-data-type")
@StatisticsMaximumMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-maximum-must-be-an-iso-date-on-date-data-type")
@StatisticsMedianMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-median-must-be-an-iso-date-on-date-data-type")
@StatisticsFirstQuartileMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-first-quartile-must-be-an-iso-date-on-date-data-type")
@StatisticsThirdQuartileMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-third-quartile-must-be-an-iso-date-on-date-data-type")
@ValidResponseValueMustBeANumberOnNumericDataType(message="variable-management.error.variable.valid-response-value-must-be-a-number-on-numeric-data-type")
@StatisticsMinimumMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-minimum-must-be-a-number-on-numeric-data-type")
@StatisticsMaximumMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-maximum-must-be-a-number-on-numeric-data-type")
@StatisticsMedianMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-median-must-be-a-number-on-numeric-data-type")
@StatisticsFirstQuartileMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-first-quartile-must-be-a-number-on-numeric-data-type")
@StatisticsThirdQuartileMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-third-quartile-must-be-a-number-on-numeric-data-type")
public class Variable
extends AbstractShadowableRdcDomainObject
A variable contains the results from at least one
Survey
. These results can be the
responses from participants of an online survey, hence a variable can result from
RelatedQuestion
s. A variable is part of exactly one DataSet
.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe access way of this variable.private @I18nStringSize(max=2048,message="variable-management.error.variable.annotations.i18n-string-size") I18nString
Arbitrary additional text for this variable.private @NotEmpty(message="variable-management.error.variable.data-acquisition-project.id.not-empty") String
The id of theDataAcquisitionProject
to which this variable belongs.private @NotEmpty(message="variable-management.error.variable.dataPackage-id.not-empty") String
Id of theDataPackage
to which this variable belongs.private @NotEmpty(message="variable-management.error.variable.data-set-id-not-empty") String
The id of theDataSet
to which this variable belongs.private @NotNull(message="variable-management.error.variable.data-set-number-not-null") Integer
The number of theDataSet
to which this variable belongs.private @NotNull(message="variable-management.error.variable.data-type.not-null") I18nString
The technical type which theValidResponse
s have.private @Size(max=512,message="variable-management.error.variable.derived-variables-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$",message="variable-management.error.variable.derived-variables-identifier-pattern") String
Identifier used to group variables within thisDataSet
which have been derived from each other.private @Valid Distribution
TheDistribution
contains the descriptives of this variable meaningValidResponse
s,Missing
s andStatistics
.private Boolean
Flag indicating whether theValidResponse
s should be displayed with a thousands separator or not.private @Valid FilterDetails
FilterDetails
of a variable describe the condition which must have evaluated to true before a participant was asked aQuestion
resulting in this variable.private @Valid GenerationDetails
GenerationDetails
describe how this variable was generated from one or more input variables.private String
The id of the variable which uniquely identifies the variable in this application.private @NotNull(message="variable-management.error.variable.data-set-index-not-null") Integer
The index in theDataSet
of this variable.private @NotNull(message="variable-management.error.variable.label.not-null") @I18nStringSize(max=512,message="variable-management.error.variable.label.i18n-string-size") I18nString
The label of the variable should describe its content.private @NotEmpty(message="variable-management.error.variable.master-id.not-empty") @Size(max=512,message="variable-management.error.variable.master-id.size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\$]*$",message="variable-management.error.variable.master-id.pattern") String
private @NotEmpty(message="variable-management.error.variable.name.not-empty") @Size(max=32,message="variable-management.error.variable.name.size") @Pattern(regexp="^[_a-zA-Z][_a-zA-Z0-9]*$",message="variable-management.error.variable.name.pattern") String
The name of the variable as it is used in theDataSet
.private @Size(max=512,message="variable-management.error.pid.size") @Pattern(message="variable-management.error.pid.pattern",regexp="^21\\.T11998\\/dzhw:([_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\/\\:.]{1,}$)") String
The PID of the variable.private @Valid List<RelatedQuestion>
List ofRelatedQuestion
s which have been asked to generate the values of this variable.List of ids of variables which are "related" to this variable.private @Size(max=512,message="variable-management.error.variable.repeated-measurement-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$",message="variable-management.error.variable.repeated-measurement-pattern") String
Identifier used to group variables within thisDataSet
which measure the same across multiple waves.private @NotNull(message="variable-management.error.variable.scaleLevel.not-null") I18nString
The scale level (or level of measurement) classifies the nature of information within the values assigned to this variable (ValidResponse
s).private static final long
private @NotNull(message="variable-management.error.variable.storage-type.not-null") String
Associated with each data type is a storage type.List of ids ofSurvey
s which have been conducted to create this variable.private @NotEmpty(message="variable-management.error.variable.survey-numbers-not-empty") List<Integer>
List of numbers ofSurvey
s which have been conducted to create this variable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
setIdInternal
(String id) Set id on implementation ofAbstractShadowableRdcDomainObject
.protected void
setMasterIdInternal
(String masterId) Set masterId on implementations ofAbstractShadowableRdcDomainObject
.Methods inherited from class eu.dzhw.fdz.metadatamanagement.common.domain.AbstractShadowableRdcDomainObject
getMasterId, setId, setMasterId
Methods inherited from class eu.dzhw.fdz.metadatamanagement.common.domain.AbstractRdcDomainObject
getId
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
id
The id of the variable which uniquely identifies the variable in this application. The id must not be empty and must be of the form var-{{dataAcquisitionProjectId}}-ds{{dataSetNumber}}-{{name}}$. The id must not contain more than 512 characters. -
masterId
@NotEmpty(message="variable-management.error.variable.master-id.not-empty") @Size(max=512, message="variable-management.error.variable.master-id.size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\$]*$", message="variable-management.error.variable.master-id.pattern") private @NotEmpty(message="variable-management.error.variable.master-id.not-empty") @Size(max=512,message="variable-management.error.variable.master-id.size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\$]*$",message="variable-management.error.variable.master-id.pattern") String masterId -
pid
@Size(max=512, message="variable-management.error.pid.size") @Pattern(message="variable-management.error.pid.pattern", regexp="^21\\.T11998\\/dzhw:([_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\/\\:.]{1,}$)") private @Size(max=512,message="variable-management.error.pid.size") @Pattern(message="variable-management.error.pid.pattern",regexp="^21\\.T11998\\/dzhw:([_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\/\\:.]{1,}$)") String pidThe PID of the variable. Must not contain more than 512 characters. Must match the pattern of a PID "21.T11998/dzhw:{DataPackageID}_{VariableID}:{version} -
dataAcquisitionProjectId
@NotEmpty(message="variable-management.error.variable.data-acquisition-project.id.not-empty") private @NotEmpty(message="variable-management.error.variable.data-acquisition-project.id.not-empty") String dataAcquisitionProjectIdThe id of theDataAcquisitionProject
to which this variable belongs. The dataAcquisitionProjectId must not be empty. -
name
@NotEmpty(message="variable-management.error.variable.name.not-empty") @Size(max=32, message="variable-management.error.variable.name.size") @Pattern(regexp="^[_a-zA-Z][_a-zA-Z0-9]*$", message="variable-management.error.variable.name.pattern") private @NotEmpty(message="variable-management.error.variable.name.not-empty") @Size(max=32,message="variable-management.error.variable.name.size") @Pattern(regexp="^[_a-zA-Z][_a-zA-Z0-9]*$",message="variable-management.error.variable.name.pattern") String name -
label
@NotNull(message="variable-management.error.variable.label.not-null") @I18nStringSize(max=512, message="variable-management.error.variable.label.i18n-string-size") @I18nStringNotEmpty(message="variable-management.error.variable.label.i18n-string-not-empty") private @NotNull(message="variable-management.error.variable.label.not-null") @I18nStringSize(max=512,message="variable-management.error.variable.label.i18n-string-size") I18nString labelThe label of the variable should describe its content. It must be specified in at least one language and it must not contain more than 512 characters. -
annotations
@I18nStringSize(max=2048, message="variable-management.error.variable.annotations.i18n-string-size") private @I18nStringSize(max=2048,message="variable-management.error.variable.annotations.i18n-string-size") I18nString annotationsArbitrary additional text for this variable. Markdown is supported. Must not contain more than 2048 characters. -
dataSetId
@NotEmpty(message="variable-management.error.variable.data-set-id-not-empty") private @NotEmpty(message="variable-management.error.variable.data-set-id-not-empty") String dataSetIdThe id of theDataSet
to which this variable belongs. Must not be empty. -
dataSetNumber
@NotNull(message="variable-management.error.variable.data-set-number-not-null") private @NotNull(message="variable-management.error.variable.data-set-number-not-null") Integer dataSetNumberThe number of theDataSet
to which this variable belongs. Must not be empty. -
dataType
@NotNull(message="variable-management.error.variable.data-type.not-null") @ValidDataType(message="variable-management.error.variable.data-type.valid-data-type") private @NotNull(message="variable-management.error.variable.data-type.not-null") I18nString dataTypeThe technical type which theValidResponse
s have. Must be one ofDataTypes
and must not be empty. -
storageType
@NotNull(message="variable-management.error.variable.storage-type.not-null") @ValidStorageType(message="variable-management.error.variable.storage-type.valid-storage-type") private @NotNull(message="variable-management.error.variable.storage-type.not-null") String storageTypeAssociated with each data type is a storage type. For instance numerics can be stored as integer or double. Must be one ofStorageTypes
and must not be empty. -
scaleLevel
@NotNull(message="variable-management.error.variable.scaleLevel.not-null") @ValidScaleLevel(message="variable-management.error.variable.scaleLevel.valid-scale-level") private @NotNull(message="variable-management.error.variable.scaleLevel.not-null") I18nString scaleLevelThe scale level (or level of measurement) classifies the nature of information within the values assigned to this variable (ValidResponse
s). It determines which mathematical operations can be performed with the values. It must be one ofScaleLevels
and must not be empty. If the data type of this variable isDataTypes.DATE
then the ScaleLevel must beScaleLevels.ORDINAL
,ScaleLevels.INTERVAL
orScaleLevels.NOMINAL
. -
accessWays
@NotEmpty(message="variable-management.error.variable.access-ways.not-empty") @ValidAccessWays(message="variable-management.error.variable.access-ways.valid-access-ways") private @NotEmpty(message="variable-management.error.variable.access-ways.not-empty") List<String> accessWaysThe access way of this variable. Depends on the sensitivity of the data and describes how the data user will be able to work with the data. Must not be empty and be one ofAccessWays
. -
indexInDataSet
@NotNull(message="variable-management.error.variable.data-set-index-not-null") private @NotNull(message="variable-management.error.variable.data-set-index-not-null") Integer indexInDataSet -
surveyNumbers
@NotEmpty(message="variable-management.error.variable.survey-numbers-not-empty") private @NotEmpty(message="variable-management.error.variable.survey-numbers-not-empty") List<Integer> surveyNumbersList of numbers ofSurvey
s which have been conducted to create this variable. Must not be empty. -
repeatedMeasurementIdentifier
@Size(max=512, message="variable-management.error.variable.repeated-measurement-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$", message="variable-management.error.variable.repeated-measurement-pattern") private @Size(max=512,message="variable-management.error.variable.repeated-measurement-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$",message="variable-management.error.variable.repeated-measurement-pattern") String repeatedMeasurementIdentifierIdentifier used to group variables within thisDataSet
which measure the same across multiple waves. Must be of the form {{dataAcquisitionProjectId}}-ds{{dataSetNumber}}-{{string}}$. Must not contain more than 512 characters and must contain only (german) alphanumeric characters and "_" and "-". -
derivedVariablesIdentifier
@Size(max=512, message="variable-management.error.variable.derived-variables-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$", message="variable-management.error.variable.derived-variables-identifier-pattern") private @Size(max=512,message="variable-management.error.variable.derived-variables-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$",message="variable-management.error.variable.derived-variables-identifier-pattern") String derivedVariablesIdentifierIdentifier used to group variables within thisDataSet
which have been derived from each other. For instance one variable might be an aggregated version of the other. Must be of the form {{dataAcquisitionProjectId}}-ds{{dataSetNumber}}-{{string}}$. Must not contain more than 512 characters and must contain only (german) alphanumeric characters and "_" and "-". -
filterDetails
FilterDetails
of a variable describe the condition which must have evaluated to true before a participant was asked aQuestion
resulting in this variable. -
generationDetails
GenerationDetails
describe how this variable was generated from one or more input variables. -
distribution
TheDistribution
contains the descriptives of this variable meaningValidResponse
s,Missing
s andStatistics
. -
doNotDisplayThousandsSeparator
Flag indicating whether theValidResponse
s should be displayed with a thousands separator or not. For instance years (1970) are numeric but should not be displayed with a thousands separator. Default value is false indicating that theValidResponse
s are displayed with thousands separator. -
dataPackageId
@NotEmpty(message="variable-management.error.variable.dataPackage-id.not-empty") private @NotEmpty(message="variable-management.error.variable.dataPackage-id.not-empty") String dataPackageIdId of theDataPackage
to which this variable belongs. -
surveyIds
List of ids ofSurvey
s which have been conducted to create this variable. Must not be empty.
-
-
Constructor Details
-
Variable
-
-
Method Details
-
setMasterIdInternal
Description copied from class:AbstractShadowableRdcDomainObject
Set masterId on implementations ofAbstractShadowableRdcDomainObject
.- Specified by:
setMasterIdInternal
in classAbstractShadowableRdcDomainObject
- Parameters:
masterId
- Master Id
-
setIdInternal
Description copied from class:AbstractShadowableRdcDomainObject
Set id on implementation ofAbstractShadowableRdcDomainObject
.- Specified by:
setIdInternal
in classAbstractShadowableRdcDomainObject
- Parameters:
id
- Id
-