Example:
// to only include specified fields from being serialized or deserialized
// (i.e. only include in JSON output; or being set even if they were included)
@JsonIncludeProperties({ "internalId", "secretKey" })
Annotation can be applied both to classes and to properties. If used for both, actual set will be union of all includes: that is, you can only add properties to include, not remove or override. So you can not remove properties to include using per-property annotation.
| Modifier and Type | Class and Description |
|---|---|
| public static class | JsonIncludeProperties.Value
Helper class used to contain information from a single |
| Modifier and Type | Method and Description |
|---|---|
| public String[] |
| value | back to summary |
|---|---|
| public String[] value() Names of properties to include. | |
JsonIncludeProperties
annotation, as well as to provide possible overrides from non-annotation sources.
| Modifier and Type | Field and Description |
|---|---|
| protected final Set | _included
Name of the properties to include. |
| protected static final JsonIncludeProperties. | ALL
Default instance has no explicitly included fields |
| private static final long |
| Modifier and Type | Method and Description |
|---|---|
| private static Set | |
| private static boolean | |
| public static JsonIncludeProperties. | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public static JsonIncludeProperties. | |
| public Set | |
| public int | |
| public String | |
| public Class | valueFor()
Implements com. |
| public JsonIncludeProperties. | withOverrides(JsonIncludeProperties.
Mutant factory method to override the current value with an another,
merging the included fields so that only entries that exist in both original
and override set are included, taking into account that "undefined" |
| _included | back to summary |
|---|---|
| protected final Set<String> _included Name of the properties to include. Null means that all properties are included, empty means none. | |
| ALL | back to summary |
|---|---|
| protected static final JsonIncludeProperties. Default instance has no explicitly included fields | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| Value | back to summary |
|---|---|
| protected Value(Set<String> included) | |
| _asSet | back to summary |
|---|---|
| private static Set | |
| _equals | back to summary |
|---|---|
| private static boolean _equals(Set<String> a, Set<String> b) | |
| all | back to summary |
|---|---|
| public static JsonIncludeProperties. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| from | back to summary |
|---|---|
| public static JsonIncludeProperties. | |
| getIncluded | back to summary |
|---|---|
| public Set | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| valueFor | back to summary |
|---|---|
| public Class Implements com. Doc from com. Introspection method that may be used to find actual annotation that may be used as the source for value instance.
| |
| withOverrides | back to summary |
|---|---|
| public JsonIncludeProperties. Mutant factory method to override the current value with an another,
merging the included fields so that only entries that exist in both original
and override set are included, taking into account that "undefined" | |