当前位置: 首页>>代码示例>>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;未经允许,请勿转载。