Package com.fasterxml.jackson.annotation
Class JsonIncludeProperties.Value
- java.lang.Object
-
- com.fasterxml.jackson.annotation.JsonIncludeProperties.Value
-
- All Implemented Interfaces:
JacksonAnnotationValue<JsonIncludeProperties>
,java.io.Serializable
- Enclosing class:
- JsonIncludeProperties
public static class JsonIncludeProperties.Value extends java.lang.Object implements JacksonAnnotationValue<JsonIncludeProperties>, java.io.Serializable
Helper class used to contain information from a singleJsonIncludeProperties
annotation, as well as to provide possible overrides from non-annotation sources.- Since:
- 2.12
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<java.lang.String>
_included
Name of the properties to include.protected static JsonIncludeProperties.Value
ALL
Default instance has no explicitly included fields
-
Constructor Summary
Constructors Modifier Constructor Description protected
Value(java.util.Set<java.lang.String> included)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonIncludeProperties.Value
all()
boolean
equals(java.lang.Object o)
static JsonIncludeProperties.Value
from(JsonIncludeProperties src)
java.util.Set<java.lang.String>
getIncluded()
int
hashCode()
java.lang.String
toString()
java.lang.Class<JsonIncludeProperties>
valueFor()
Introspection method that may be used to find actual annotation that may be used as the source for value instance.JsonIncludeProperties.Value
withOverrides(JsonIncludeProperties.Value overrides)
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"JsonIncludeProperties.Value
s do not count ("undefined" meaning thatgetIncluded()
returnsnull
).
-
-
-
Field Detail
-
ALL
protected static final JsonIncludeProperties.Value ALL
Default instance has no explicitly included fields
-
_included
protected final java.util.Set<java.lang.String> _included
Name of the properties to include. Null means that all properties are included, empty means none.
-
-
Method Detail
-
from
public static JsonIncludeProperties.Value from(JsonIncludeProperties src)
-
all
public static JsonIncludeProperties.Value all()
-
valueFor
public java.lang.Class<JsonIncludeProperties> valueFor()
Description copied from interface:JacksonAnnotationValue
Introspection method that may be used to find actual annotation that may be used as the source for value instance.- Specified by:
valueFor
in interfaceJacksonAnnotationValue<JsonIncludeProperties>
- Returns:
- Annotation class for which instances of this value class are created
-
getIncluded
public java.util.Set<java.lang.String> getIncluded()
- Returns:
- Names included, if any, possibly empty;
null
for "not defined"
-
withOverrides
public JsonIncludeProperties.Value withOverrides(JsonIncludeProperties.Value overrides)
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"JsonIncludeProperties.Value
s do not count ("undefined" meaning thatgetIncluded()
returnsnull
). So: overriding with "undefined" returns originalValue
as-is; overriding an "undefined"Value
returns overrideValue
as-is.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-