#1198 - Moved of deprecated @Wither in favor of @With.

This commit is contained in:
Oliver Drotbohm
2020-02-11 18:05:34 +01:00
parent d060e4b155
commit 29479b82d9
21 changed files with 57 additions and 57 deletions

View File

@@ -19,7 +19,7 @@ import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.Wither;
import lombok.With;
import java.io.Serializable;
import java.net.URI;
@@ -89,14 +89,14 @@ public class Link implements Serializable {
public static final @Deprecated LinkRelation REL_LAST = IanaLinkRelations.LAST;
private LinkRelation rel;
private @Wither String href;
private @Wither String hreflang;
private @Wither String media;
private @Wither String title;
private @Wither String type;
private @Wither String deprecation;
private @Wither String profile;
private @Wither String name;
private @With String href;
private @With String hreflang;
private @With String media;
private @With String title;
private @With String type;
private @With String deprecation;
private @With String profile;
private @With String name;
private @JsonIgnore UriTemplate template;
private @JsonIgnore List<Affordance> affordances;

View File

@@ -18,7 +18,7 @@ package org.springframework.hateoas;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.Optional;
@@ -41,7 +41,7 @@ import org.springframework.web.bind.annotation.RequestParam;
public class QueryParameter {
private final String name;
private final @Nullable @Wither String value;
private final @Nullable @With String value;
private final boolean required;
/**

View File

@@ -19,7 +19,7 @@ import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.Collections;
import java.util.HashMap;
@@ -49,12 +49,12 @@ public class Hop {
/**
* Collection of URI Template parameters.
*/
private final @Wither Map<String, Object> parameters;
private final @With Map<String, Object> parameters;
/**
* Extra {@link HttpHeaders} to apply to this hop.
*/
private final @Wither HttpHeaders headers;
private final @With HttpHeaders headers;
/**
* Creates a new {@link Hop} for the given relation name.

View File

@@ -20,7 +20,7 @@ import static java.util.stream.Collectors.*;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.experimental.Wither;
import lombok.With;
import java.util.ArrayList;
import java.util.Arrays;
@@ -98,12 +98,12 @@ public class Affordances implements AffordanceOperations {
private final Affordances context;
private final HttpMethod method;
private final @Wither Link target;
private final @With Link target;
private final InputPayloadMetadata inputMetdata;
private final PayloadMetadata outputMetadata;
private List<QueryParameter> parameters = Collections.emptyList();
private @Nullable @Wither String name;
private @Nullable @With String name;
/**
* Registers the given type as input and output model for the affordance.

View File

@@ -18,7 +18,7 @@ package org.springframework.hateoas.mediatype.collectionjson;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.Arrays;
import java.util.Collections;
@@ -41,7 +41,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@Value
@Getter(onMethod = @__(@JsonProperty))
@Wither(AccessLevel.PACKAGE)
@With(AccessLevel.PACKAGE)
class CollectionJson<T> {
private String version;

View File

@@ -17,7 +17,7 @@ package org.springframework.hateoas.mediatype.collectionjson;
import lombok.Getter;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import org.springframework.lang.Nullable;
@@ -32,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@Value
@Getter(onMethod = @__(@JsonProperty))
@JsonInclude(Include.NON_NULL)
@Wither
@With
class CollectionJsonData {
private @Nullable String name;

View File

@@ -19,7 +19,7 @@ import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.List;
@@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@Value
@Getter(onMethod = @__(@JsonProperty))
@Wither(AccessLevel.PACKAGE)
@With(AccessLevel.PACKAGE)
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
class CollectionJsonDocument<T> {

View File

@@ -17,7 +17,7 @@ package org.springframework.hateoas.mediatype.collectionjson;
import lombok.AccessLevel;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import org.springframework.lang.Nullable;
@@ -28,7 +28,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @author Greg Turnquist
*/
@Value
@Wither(AccessLevel.PACKAGE)
@With(AccessLevel.PACKAGE)
class CollectionJsonError {
private String title;

View File

@@ -19,7 +19,7 @@ import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.Collections;
import java.util.List;
@@ -46,7 +46,7 @@ import com.fasterxml.jackson.databind.JavaType;
*/
@Value
@Getter(onMethod = @__(@JsonProperty))
@Wither(AccessLevel.PACKAGE)
@With(AccessLevel.PACKAGE)
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
class CollectionJsonItem<T> {

View File

@@ -18,7 +18,7 @@ package org.springframework.hateoas.mediatype.collectionjson;
import static com.fasterxml.jackson.annotation.JsonInclude.*;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.List;
@@ -32,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @author Greg Turnquist
*/
@Value
@Wither
@With
class CollectionJsonQuery {
@JsonInclude(Include.NON_NULL) private String rel;

View File

@@ -16,7 +16,7 @@
package org.springframework.hateoas.mediatype.collectionjson;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.List;
@@ -29,7 +29,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @author Greg Turnquist
*/
@Value
@Wither
@With
class CollectionJsonTemplate {
private List<CollectionJsonData> data;

View File

@@ -18,7 +18,7 @@ package org.springframework.hateoas.mediatype.hal;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.experimental.Wither;
import lombok.With;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -45,20 +45,20 @@ public class HalConfiguration {
* Configures how to render links in case there is exactly one defined for a given link relation in general. By
* default, this single link will be rendered as nested document.
*/
private final @Wither @Getter RenderSingleLinks renderSingleLinks;
private final @Wither(AccessLevel.PRIVATE) Map<String, RenderSingleLinks> singleLinksPerPattern;
private final @With @Getter RenderSingleLinks renderSingleLinks;
private final @With(AccessLevel.PRIVATE) Map<String, RenderSingleLinks> singleLinksPerPattern;
/**
* Configures whether the Jackson property naming strategy is applied to link relations and within {@code _embedded}
* clauses.
*/
private final @Wither @Getter boolean applyPropertyNamingStrategy;
private final @With @Getter boolean applyPropertyNamingStrategy;
/**
* Configures whether to always use collections for embeddeds, even if there's only one entry for a link relation.
* Defaults to {@literal true}.
*/
private final @Wither @Getter boolean enforceEmbeddedCollections;
private final @With @Getter boolean enforceEmbeddedCollections;
/**
* Creates a new default {@link HalConfiguration} rendering single links as immediate sub-document.

View File

@@ -17,7 +17,7 @@ package org.springframework.hateoas.mediatype.hal;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.experimental.Wither;
import lombok.With;
import java.util.ArrayList;
import java.util.Collection;
@@ -56,7 +56,7 @@ class HalEmbeddedBuilder {
/**
* Returns a {@link HalEmbeddedBuilder} with the given transformer
*/
private final @Wither Function<String, String> relationTransformer;
private final @With Function<String, String> relationTransformer;
/**
* Creates a new {@link HalEmbeddedBuilder} using the given {@link LinkRelationProvider} and prefer collection rels

View File

@@ -19,7 +19,7 @@ import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.Collection;
import java.util.Collections;
@@ -56,14 +56,14 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
* @author Oliver Gierke
*/
@Value
@Wither
@With
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
@JsonPropertyOrder({ "attributes", "entity", "entities", "embedded", "links", "templates", "metadata" })
public class HalFormsDocument<T> {
@Nullable //
@Getter(onMethod = @__(@JsonAnyGetter)) @JsonInclude(Include.NON_EMPTY) //
@Wither(AccessLevel.PRIVATE) //
@With(AccessLevel.PRIVATE) //
private Map<String, Object> attributes;
@Nullable //
@@ -74,7 +74,7 @@ public class HalFormsDocument<T> {
@Nullable //
@JsonInclude(Include.NON_EMPTY) //
@JsonIgnore //
@Wither(AccessLevel.PRIVATE) //
@With(AccessLevel.PRIVATE) //
private Collection<T> entities;
@JsonProperty("_embedded") //

View File

@@ -22,7 +22,7 @@ import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.ToString;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import org.springframework.hateoas.AffordanceModel.Named;
import org.springframework.hateoas.AffordanceModel.PropertyMetadata;
@@ -40,7 +40,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_DEFAULT)
@Value
@Wither
@With
@Getter(onMethod = @__(@JsonProperty))
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true)

View File

@@ -22,7 +22,7 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Wither;
import lombok.With;
import java.util.ArrayList;
import java.util.Collections;
@@ -53,7 +53,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
*/
@Data
@Setter(AccessLevel.NONE)
@Wither
@With
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@EqualsAndHashCode
@ToString
@@ -65,7 +65,7 @@ public class HalFormsTemplate {
public static final String DEFAULT_KEY = "default";
private @Getter(onMethod = @__(@JsonInclude(Include.NON_EMPTY))) String title;
private @Wither(AccessLevel.PRIVATE) HttpMethod httpMethod;
private @With(AccessLevel.PRIVATE) HttpMethod httpMethod;
private List<HalFormsProperty> properties;
private List<MediaType> contentTypes;

View File

@@ -22,8 +22,8 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.Value;
import lombok.With;
import lombok.experimental.NonFinal;
import lombok.experimental.Wither;
import java.net.URI;
import java.util.HashMap;
@@ -52,7 +52,7 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped;
* @author Oliver Drotbohm
*/
@Getter(onMethod = @__(@JsonProperty))
@Wither
@With
@ToString
@EqualsAndHashCode
@JsonInclude(Include.NON_NULL)

View File

@@ -18,7 +18,7 @@ package org.springframework.hateoas.mediatype.uber;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.List;
@@ -39,7 +39,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@Value
@Getter(onMethod = @__(@JsonProperty))
@Wither(AccessLevel.PACKAGE)
@With(AccessLevel.PACKAGE)
@JsonInclude(Include.NON_NULL)
class Uber {

View File

@@ -19,7 +19,7 @@ import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.ArrayList;
import java.util.Arrays;
@@ -61,7 +61,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@Value
@Getter(onMethod = @__(@JsonProperty))
@Wither(AccessLevel.PACKAGE)
@With(AccessLevel.PACKAGE)
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
class UberData {

View File

@@ -19,7 +19,7 @@ import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.List;
@@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@Value
@Getter(onMethod = @__(@JsonProperty))
@Wither(AccessLevel.PACKAGE)
@With(AccessLevel.PACKAGE)
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
class UberDocument {

View File

@@ -17,7 +17,7 @@ package org.springframework.hateoas.mediatype.uber;
import lombok.AccessLevel;
import lombok.Value;
import lombok.experimental.Wither;
import lombok.With;
import java.util.List;
@@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @since 1.0
*/
@Value
@Wither(AccessLevel.PACKAGE)
@With(AccessLevel.PACKAGE)
class UberError {
private List<UberData> data;