當前位置: 首頁>>代碼示例>>Java>>正文


Java SchemaId類代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:openmhealth,項目名稱:shimmer,代碼行數:23,代碼來源:DataPointMapper.java

示例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));
}
 
開發者ID:openmhealth,項目名稱:shimmer,代碼行數:13,代碼來源:IHealthDataPointMapperUnitTests.java

示例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);
}
 
開發者ID:openmhealth,項目名稱:shimmer,代碼行數:13,代碼來源:GoogleFitDataPointMapperUnitTests.java

示例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);
}
 
開發者ID:openmhealth,項目名稱:shimmer,代碼行數:13,代碼來源:GoogleFitDataPointMapperUnitTests.java

示例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);
}
 
開發者ID:openmhealth,項目名稱:shimmer,代碼行數:16,代碼來源:GoogleFitDataPointMapperUnitTests.java

示例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;
}
 
開發者ID:openmhealth,項目名稱:shimmer,代碼行數:33,代碼來源:GoogleFitDataPointMapperUnitTests.java

示例7: getSchemaId

import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
@Override
public SchemaId getSchemaId() {
	return BloodGlucose.SCHEMA_ID;
}
 
開發者ID:petezybrick,項目名稱:iote2e,代碼行數:5,代碼來源:SimSchemaImpl.java

示例8: getBodySchemaId

import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
public SchemaId getBodySchemaId() {
    return bodySchemaId;
}
 
開發者ID:openmhealth,項目名稱:shimmer,代碼行數:4,代碼來源:GoogleFitTestProperties.java

示例9: setBodySchemaId

import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
public void setBodySchemaId(SchemaId bodySchemaId) {
    this.bodySchemaId = bodySchemaId;
}
 
開發者ID:openmhealth,項目名稱:shimmer,代碼行數:4,代碼來源:GoogleFitTestProperties.java

示例10: getSchemaId

import org.openmhealth.schema.domain.omh.SchemaId; //導入依賴的package包/類
/**
 * Gets the schema id.
 *
 * @return the schema id
 */
public SchemaId getSchemaId();
 
開發者ID:petezybrick,項目名稱:iote2e,代碼行數:7,代碼來源:SimSchema.java


注:本文中的org.openmhealth.schema.domain.omh.SchemaId類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。