本文整理匯總了Java中org.openmhealth.schema.domain.omh.SchemaId類的典型用法代碼示例。如果您正苦於以下問題:Java SchemaId類的具體用法?Java SchemaId怎麽用?Java SchemaId使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SchemaId類屬於org.openmhealth.schema.domain.omh包,在下文中一共展示了SchemaId類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getBodySchemaId
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
/**
* Gets the schema identifier of the data point body that this mapper creates. This default implementation assumes
* that body classes have a default constructor used for serialization, and must be overridden if they don't.
*
* @return the schema identifier of the body type
*/
@SuppressWarnings("unchecked")
default SchemaId getBodySchemaId() {
try {
Class<B> bodyClass = (Class<B>)
((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
Constructor<B> bodyClassConstructor = bodyClass.getDeclaredConstructor();
bodyClassConstructor.setAccessible(true);
return bodyClassConstructor.newInstance().getSchemaId();
}
catch (NoSuchMethodException | InstantiationException | InvocationTargetException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
示例2: testDataPointHeader
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
protected void testDataPointHeader(DataPointHeader testHeader, SchemaId schemaId, DataPointModality modality,
String externalId, OffsetDateTime updatedDateTime) {
assertThat(testHeader.getBodySchemaId(), equalTo(schemaId));
assertThat(testHeader.getAcquisitionProvenance().getModality(), equalTo(modality));
assertThat(testHeader.getAcquisitionProvenance().getSourceName(),
equalTo(RESOURCE_API_SOURCE_NAME));
assertThat(testHeader.getAcquisitionProvenance().getAdditionalProperties().get("external_id"), equalTo(
externalId));
assertThat(testHeader.getAcquisitionProvenance().getAdditionalProperties().get("source_updated_date_time"),
equalTo(updatedDateTime));
}
示例3: createFloatingPointTestProperties
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
/**
* Creates a test properties object used to generate an expected value data point to test google fit data points
* that use floating point values in their response.
*
* @deprecated use varargs instead
*/
@Deprecated
public GoogleFitTestProperties createFloatingPointTestProperties(double fpValue, String startDateTime,
String endDateTime, String sourceOriginId, SchemaId schemaId) {
return createTestProperties(startDateTime, endDateTime, sourceOriginId, schemaId, fpValue);
}
示例4: createIntegerTestProperties
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
/**
* Creates a test properties object used to generate an expected value data point to test google fit data points
* that use integer values in their response.
*
* @deprecated use varargs instead
*/
@Deprecated
public GoogleFitTestProperties createIntegerTestProperties(long intValue, String startDateTime, String endDateTime,
String sourceOriginId, SchemaId schemaId) {
return createTestProperties(startDateTime, endDateTime, sourceOriginId, schemaId, intValue);
}
示例5: createStringTestProperties
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
/**
* Creates a test properties object used to generate an expected value data point to test google fit data points
* that use strings to represent values.
*
* @deprecated use varargs instead
*/
public GoogleFitTestProperties createStringTestProperties(
String stringValue,
String startDateTime,
String endDateTime,
String sourceOriginId,
SchemaId schemaId) {
return createTestProperties(startDateTime, endDateTime, sourceOriginId, schemaId, stringValue);
}
示例6: createTestProperties
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
public GoogleFitTestProperties createTestProperties(
String startDateTimeString,
String endDateTimeString,
String sourceOriginId,
SchemaId schemaId,
Object... values) {
GoogleFitTestProperties testProperties = new GoogleFitTestProperties();
if (startDateTimeString != null) {
testProperties.setEffectiveStartDateTime(startDateTimeString);
}
if (endDateTimeString != null) {
testProperties.setEffectiveEndDateTime(endDateTimeString);
}
if (sourceOriginId != null) {
testProperties.setSourceOriginId(sourceOriginId);
if (sourceOriginId.endsWith("user_input")) {
testProperties.setModality(SELF_REPORTED);
}
}
testProperties.setBodySchemaId(schemaId);
Arrays.stream(values).forEach(testProperties::addValue);
return testProperties;
}
示例7: getSchemaId
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
@Override
public SchemaId getSchemaId() {
return BloodGlucose.SCHEMA_ID;
}
示例8: getBodySchemaId
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
public SchemaId getBodySchemaId() {
return bodySchemaId;
}
示例9: setBodySchemaId
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
public void setBodySchemaId(SchemaId bodySchemaId) {
this.bodySchemaId = bodySchemaId;
}
示例10: getSchemaId
import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
/**
* Gets the schema id.
*
* @return the schema id
*/
public SchemaId getSchemaId();