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


Java Include.NON_EMPTY屬性代碼示例

本文整理匯總了Java中com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY屬性的典型用法代碼示例。如果您正苦於以下問題:Java Include.NON_EMPTY屬性的具體用法?Java Include.NON_EMPTY怎麽用?Java Include.NON_EMPTY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.fasterxml.jackson.annotation.JsonInclude.Include的用法示例。


在下文中一共展示了Include.NON_EMPTY屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testSimpleMerge

public void testSimpleMerge()
{
    JsonInclude.Value empty = JsonInclude.Value.empty();

    assertEquals(Include.USE_DEFAULTS, empty.getValueInclusion());
    assertEquals(Include.USE_DEFAULTS, empty.getContentInclusion());
    
    JsonInclude.Value v2 = empty.withValueInclusion(Include.NON_ABSENT);

    assertEquals(Include.NON_ABSENT, v2.getValueInclusion());
    assertEquals(Include.USE_DEFAULTS, v2.getContentInclusion());

    JsonInclude.Value v3 = new JsonInclude.Value(Include.NON_EMPTY, Include.ALWAYS,
            null, null);
    assertEquals(Include.NON_EMPTY, v3.getValueInclusion());
    assertEquals(Include.ALWAYS, v3.getContentInclusion());

    // Ok; but then overrides, which should skip 'USE_DEFAULT' overrides
    JsonInclude.Value merged = v3.withOverrides(empty);
    // no overrides with "empty":
    assertEquals(v3.getValueInclusion(), merged.getValueInclusion());
    assertEquals(v3.getContentInclusion(), merged.getContentInclusion());

    // but other values ought to be overridden (value, yes, content, no because it's default)
    merged = JsonInclude.Value.merge(v3, v2);
    assertEquals(v2.getValueInclusion(), merged.getValueInclusion());
    assertEquals(v3.getContentInclusion(), merged.getContentInclusion());

    merged = JsonInclude.Value.mergeAll(empty, v3);
    assertEquals(v3.getValueInclusion(), merged.getValueInclusion());
    assertEquals(v3.getContentInclusion(), merged.getContentInclusion());
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:32,代碼來源:IncludeTest.java

示例2: JsonMapper

public JsonMapper() {
	this(Include.NON_EMPTY);
}
 
開發者ID:funtl,項目名稱:framework,代碼行數:3,代碼來源:JsonMapper.java

示例3: getLocale

@JsonInclude(Include.NON_EMPTY)
public String getLocale() {
    return locale;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:4,代碼來源:JsonObject.java

示例4: getMemo

@JsonInclude(Include.NON_EMPTY)
@JsonProperty("memo")
public String getMemo() {
  return memo;
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:5,代碼來源:LogicalOperatorBase.java

示例5: nonEmptyMapper

/**
 * 創建隻輸出非Null且非Empty(如List.isEmpty)的屬性到Json字符串的Mapper,建議在外部接口中使用.
 */
public static JsonMapper nonEmptyMapper() {
    return new JsonMapper(Include.NON_EMPTY);
}
 
開發者ID:warlock-china,項目名稱:azeroth,代碼行數:6,代碼來源:JsonMapper.java

示例6: getProperties

@JsonInclude(Include.NON_EMPTY)
public abstract Map<String, Object> getProperties();
 
開發者ID:FraunhoferIOSB,項目名稱:SensorThingsServer,代碼行數:2,代碼來源:FeatureMixIn.java

示例7: JsonMapper

public JsonMapper() {
    this(Include.NON_EMPTY);
}
 
開發者ID:ansafari,項目名稱:melon,代碼行數:3,代碼來源:JsonMapper.java

示例8: nonEmptyMapper

/**
 * 創建隻輸出非Null且非Empty(如List.isEmpty)的屬性到Json字符串的Mapper,建議在外部接口中使用.
 */
public static JsonMapper nonEmptyMapper() {
	return new JsonMapper(Include.NON_EMPTY);
}
 
開發者ID:vakinge,項目名稱:jeesuite-libs,代碼行數:6,代碼來源:JsonMapper.java

示例9: getDescription

/**
 * Return the description of this status.
 * @return the description
 */
@JsonInclude(Include.NON_EMPTY)
public String getDescription() {
	return this.description;
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:8,代碼來源:Status.java

示例10: getActionMessages

@JsonInclude(Include.NON_EMPTY)
public Collection<String> getActionMessages() {
    return actionMessages;
}
 
開發者ID:akuma,項目名稱:meazza,代碼行數:4,代碼來源:ResponseMessage.java

示例11: getVariantAssociations

@JsonInclude(Include.NON_EMPTY)
@JsonProperty("variant_profile")
public List<VariantAssociation> getVariantAssociations() {
    return variantAssociations;
}
 
開發者ID:phenopackets,項目名稱:phenopacket-reference-implementation,代碼行數:5,代碼來源:PhenoPacket.java

示例12: getDiseaseOccurrenceAssociations

/**
 * @return the diseaseOccurrenceAssociations
 */
@JsonInclude(Include.NON_EMPTY)
@JsonProperty("diagnosis_profile")
public List<DiseaseOccurrenceAssociation> getDiseaseOccurrenceAssociations() {
    return diseaseOccurrenceAssociations;
}
 
開發者ID:phenopackets,項目名稱:phenopacket-reference-implementation,代碼行數:8,代碼來源:PhenoPacket.java

示例13: getCustomData

@JsonInclude(Include.NON_EMPTY)
public Map<String, Object> getCustomData() {
    return customData;
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:4,代碼來源:ErrorInfo.java

示例14: getParams

@JsonInclude(Include.NON_EMPTY)
public Map<String, Object> getParams() {
    return params;
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:4,代碼來源:FormField.java

示例15: isTemplated

@Override
@JsonInclude(Include.NON_EMPTY)
@JsonSerialize(using = TrueOnlyBooleanSerializer.class)
public abstract boolean isTemplated();
 
開發者ID:mockitoo,項目名稱:spring-data-rest-android,代碼行數:4,代碼來源:LinkMixin.java


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