/** * @author ben */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(Include.NON_NULL) public class DriverStatus implements Serializable { private static final long serialVersionUID = 1L; @JsonProperty("Root Dir") private String rootDir; @JsonProperty("Dirs") private Integer dirs; public String getRootDir() { return rootDir; } public Integer getDirs() { return dirs; } @Override public String toString() { return ToStringBuilder.reflectionToString(this); } }
public static Value from(JsonIgnoreProperties src) { if (src == null) { return EMPTY; // since 2.9 } return construct(_asSet(src.value()), src.ignoreUnknown(), src.allowGetters(), src.allowSetters(), // 27-Apr-2016, tatu: No matching property in annotation because // we don't know how to merge (so no point in pretending it's there) // so choice is arbitrary. Probably will default to `false` fwtw: false); }
@ParametersAreNonnullByDefault @Generated({"Immutables.generator", "RaftIndex"}) @Immutable @JsonIgnoreProperties(ignoreUnknown = true) public final class ImmutableRaftIndex extends RaftIndex {
@JsonIgnoreProperties(ignoreUnknown = true) public class BityResponse<T> { @JsonProperty("objects") private List<T> objects = null; @JsonProperty("objects") public List<T> getObjects() { return objects; } @JsonProperty("objects") public void setObjects(List<T> objects) { this.objects = objects; } }
@JsonCreator @JsonIgnoreProperties(ignoreUnknown = true) public static IndexSetUpdateRequest create(@JsonProperty("title") @NotBlank String title, @JsonProperty("description") @Nullable String description, @JsonProperty("writable") boolean isWritable, @JsonProperty("shards") @Min(1) int shards, @JsonProperty("replicas") @Min(0) int replicas, @JsonProperty("rotation_strategy_class") @NotNull String rotationStrategyClass, @JsonProperty("rotation_strategy") @NotNull RotationStrategyConfig rotationStrategy, @JsonProperty("retention_strategy_class") @NotNull String retentionStrategyClass, @JsonProperty("retention_strategy") @NotNull RetentionStrategyConfig retentionStrategy, @JsonProperty("index_optimization_max_num_segments") @Min(1L) int indexOptimizationMaxNumSegments, @JsonProperty("index_optimization_disabled") boolean indexOptimizationDisabled, @JsonProperty("field_type_refresh_interval") Duration fieldTypeRefreshInterval) { return new AutoValue_IndexSetUpdateRequest(title, description, isWritable, shards, replicas, rotationStrategyClass, rotationStrategy, retentionStrategyClass, retentionStrategy, indexOptimizationMaxNumSegments, indexOptimizationDisabled, fieldTypeRefreshInterval); }
/** * Static (not live-reloaded) portions of TimeLock's configuration. */ @JsonDeserialize(as = ImmutableTimeLockInstallConfiguration.class) @JsonSerialize(as = ImmutableTimeLockInstallConfiguration.class) @Value.Immutable @JsonIgnoreProperties(value = "asyncLock") public interface TimeLockInstallConfiguration { PaxosInstallConfiguration paxos(); ClusterConfiguration cluster(); @Value.Default default TsBoundPersisterConfiguration timestampBoundPersistence() { return ImmutablePaxosTsBoundPersisterConfiguration.builder().build(); } }
/** Template for an {@code auth} defined for a registry under {@code auths}. */ @JsonIgnoreProperties(ignoreUnknown = true) public static class AuthTemplate implements JsonTemplate { @Nullable private String auth; @Nullable public String getAuth() { return auth; } }
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @JsonDeserialize(using = MfaProvider.MfaProviderDeserializer.class) public class MfaProvider<T extends AbstractMfaProviderConfig> { @JsonProperty("last_modified") private Date lastModified;
@NoArgsConstructor @EqualsAndHashCode @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = true) public class RequestDetailsLogger { private final HttpServletRequest request = ServletContextHolder.getRequest(); @JsonProperty("request_id") private String requestId = ServletContextHolder.fetchRequestId(); @JsonProperty("url") private String url = request.getRequestURL().toString(); @JsonProperty("method") private String method = request.getMethod(); @JsonProperty("request_body") @JsonSerialize(using = StringToMapSerializer.class) private String requestBody = (String) ServletContextHolder.getRequest().getAttribute(RequestAttributeConst.REQUEST_BODY_KEY); @JsonProperty("request_time") @JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class) private OffsetDateTime requestTime = OffsetDateTime.now(); @JsonProperty("response_time") @JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class) private OffsetDateTime responseTime;
/** * @author Zhao Junjian */ @Getter @Setter @AllArgsConstructor @ToString @EqualsAndHashCode @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = true) public class Participant implements Serializable { private static final long serialVersionUID = -8013238614014494468L; @ApiModelProperty(value = "发起确认操作的URI", required = true, example = "http://www.example.com/part/123") private String uri; @ApiModelProperty(value = "过期时间, ISO标准", required = true, example = "2017-03-20T14:00:41+08:00") @JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class) private OffsetDateTime expireTime; }
@Value.Immutable @JsonDeserialize(as = ImmutableMinimumAnnotationsMapped.class) @JsonIgnoreProperties(ignoreUnknown = true) public interface MinimumAnnotationsMapped { @JsonProperty("A") String a(); @JsonProperty("B") List<Integer> b(); }
/** Parent class for image manifest JSON templates. */ @JsonIgnoreProperties(ignoreUnknown = true) public interface ManifestTemplate extends JsonTemplate { int getSchemaVersion(); }
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class ScimGroup extends ScimCore<ScimGroup> {
JsonIgnoreProperties ignoreProperties = beanDesc.getClassAnnotations().get(JsonIgnoreProperties.class); if (ignoreProperties != null) { propertiesToIgnore.addAll(Arrays.asList(ignoreProperties.value())); if (jsonPropertyAnn == null || !jsonPropertyAnn.value().equals(propName)) { if (member != null) { java.lang.reflect.Member innerMember = member.getMember();
@Override public String[] findPropertiesToIgnore(Annotated ac) { JsonIgnoreProperties ignore = _findAnnotation(ac, JsonIgnoreProperties.class); return (ignore == null) ? null : ignore.value(); }
JsonIgnoreProperties.class ); if ( jsonIgnoreProperties.isPresent() ) { builder.setIgnoredFields( new LinkedHashSet<String>( Arrays.asList( jsonIgnoreProperties.get().value() ) ) ); builder.setIgnoreUnknown( jsonIgnoreProperties.get().ignoreUnknown() ); JsonInclude.class ); if ( jsonInclude.isPresent() ) { builder.setInclude( Optional.of( jsonInclude.get().value() ) );
/** * Checks to see if a JsonIgnoreProperty annotation is present on the specified class and the supplied property is * ignored (either explicitly or implicitly if ignoreUnknown=true). * * @param cls * The class to be checked * @param property * The name of the property to be checked * @return True if the named property is ignored, or if the blanket specification ignoreUnknown=true is set. */ public static boolean isJsonIgnoreUnknownProperty(Class<?> cls, String property) { boolean result = false; JsonIgnoreProperties annotation = getAnnotation(cls, JsonIgnoreProperties.class); if (annotation != null) { String[] values = annotation.value(); if (values == null || values.length == 0) { result = annotation.ignoreUnknown(); } else { for (String value : values) { if (value.equals(property)) { result = true; break; } } } } return result; }
@Test public void shouldBeAttributedWithIgnoreUnknownProperties() { final JsonIgnoreProperties annotation = entityClass.getAnnotation(JsonIgnoreProperties.class); assertThat(entityClass + ": @JsonIgnoreProperties annotation missing", annotation, is(notNullValue())); assertThat(entityClass + ": not ignoring unknown properties", annotation.ignoreUnknown(), is(true)); } }
@ParametersAreNonnullByDefault @Generated({"Immutables.generator", "AclTokenId"}) @Immutable @JsonIgnoreProperties(ignoreUnknown = true) public final class ImmutableAclTokenId extends AclTokenId { private final String id;
@JsonIgnoreProperties({"clusterConfig", "sentinelConfig"}) public static class ConfigMixIn { @JsonProperty SentinelServersConfig sentinelServersConfig; @JsonProperty MasterSlaveServersConfig masterSlaveServersConfig; @JsonProperty SingleServerConfig singleServerConfig; @JsonProperty ClusterServersConfig clusterServersConfig; @JsonProperty ReplicatedServersConfig replicatedServersConfig; }