Skip to content

Commit

Permalink
more robust deprecation notes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Jun 5, 2024
1 parent 7e61705 commit d55b0d4
Show file tree
Hide file tree
Showing 27 changed files with 116 additions and 119 deletions.
4 changes: 2 additions & 2 deletions agrest-engine/src/main/java/io/agrest/AgRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public interface AgRequest {
List<Sort> getSorts();

/**
* @deprecated since 5.0 in favor of {@link #getSorts()}
* @deprecated in favor of {@link #getSorts()}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
default List<Sort> getOrderings() {
return getSorts();
}
Expand Down
16 changes: 8 additions & 8 deletions agrest-engine/src/main/java/io/agrest/AgRequestBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public interface AgRequestBuilder {


/**
* @deprecated since 5.0 in favor of {@link #addSort(String)}
* @deprecated in favor of {@link #addSort(String)}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
default AgRequestBuilder addOrdering(String unparsedSort) {
return addSort(unparsedSort);
}
Expand All @@ -52,9 +52,9 @@ default AgRequestBuilder addOrdering(String unparsedSort) {
AgRequestBuilder addSort(String unparsedSort, String unparsedDirection);

/**
* @deprecated since 5.0 in favor of {@link #addSort(String, String)}
* @deprecated in favor of {@link #addSort(String, String)}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
default AgRequestBuilder addOrdering(String unparsedSort, String unparsedDirection) {
return addSort(unparsedSort, unparsedDirection);
}
Expand All @@ -65,9 +65,9 @@ default AgRequestBuilder addOrdering(String unparsedSort, String unparsedDirecti
AgRequestBuilder addSort(Sort sort);

/**
* @deprecated since 5.0 in favor of {@link #addSort(Sort)}
* @deprecated in favor of {@link #addSort(Sort)}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
default AgRequestBuilder addOrdering(Sort sort) {
return addSort(sort);
}
Expand All @@ -78,9 +78,9 @@ default AgRequestBuilder addOrdering(Sort sort) {
AgRequestBuilder addSort(int index, Sort sort);

/**
* @deprecated since 5.0 in favor of {@link #addSort(int, Sort)}
* @deprecated in favor of {@link #addSort(int, Sort)}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
default AgRequestBuilder addOrdering(int index, Sort sort) {
return addSort(index, sort);
}
Expand Down
12 changes: 6 additions & 6 deletions agrest-engine/src/main/java/io/agrest/DataResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static <T> Builder<T> of(int status, List<? extends T> data) {
/**
* @deprecated in favor of the new builder created via {@link #of(int, List)}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public static <T> DataResponse<T> forObject(T object) {
Objects.requireNonNull(object);
return of(HttpStatus.OK, List.of(object)).build();
Expand All @@ -44,7 +44,7 @@ public static <T> DataResponse<T> forObject(T object) {
/**
* @deprecated in favor of the new builder created via {@link #of(int, List)}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public static <T> DataResponse<T> forObjects(List<T> data) {
return of(HttpStatus.OK, data).build();
}
Expand Down Expand Up @@ -73,9 +73,9 @@ public List<? extends T> getData() {
}

/**
* @deprecated since 5.0 in favor of {@link #getData()}.
* @deprecated in favor of {@link #getData()}.
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
public List<? extends T> getObjects() {
return data;
}
Expand Down Expand Up @@ -115,13 +115,13 @@ public Builder headers(Map<String, List<Object>> headers) {
return this;
}

@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public Builder<T> data(List<? extends T> data) {
this.data = data;
return this;
}

@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public Builder<T> status(int status) {
this.status = status;
return this;
Expand Down
4 changes: 2 additions & 2 deletions agrest-engine/src/main/java/io/agrest/DeleteBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ default DeleteBuilder<T> byIds(Object... ids) {
DeleteBuilder<T> byIds(Collection<?> ids);

/**
* @deprecated since 5.0 in favor of {@link #byId(Object)}, but keep in mind that the new API does not append the
* @deprecated in favor of {@link #byId(Object)}, but keep in mind that the new API does not append the
* ID to the internal collection, but rather replaces it. See also {@link #byIds(Object...)}.
*/
@Deprecated(since = "5.0", forRemoval = true)
DeleteBuilder<T> id(Object id);

/**
* @deprecated since 5.0 in favor of {@link #byId(Object)}, but keep in mind that the new API does not append the
* @deprecated in favor of {@link #byId(Object)}, but keep in mind that the new API does not append the
* ID to the internal collection, but rather replaces it. See also {@link #byIds(Object...)}
*/
@Deprecated(since = "5.0", forRemoval = true)
Expand Down
4 changes: 2 additions & 2 deletions agrest-engine/src/main/java/io/agrest/EntityDelete.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import io.agrest.meta.AgEntity;

/**
* @deprecated since 5.0 as DELETE HTTP method has no body.
* @deprecated as DELETE HTTP method has no body.
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
public class EntityDelete<T> {

private final AgEntity<T> entity;
Expand Down
2 changes: 1 addition & 1 deletion agrest-engine/src/main/java/io/agrest/PathConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public interface PathConstants {
* @deprecated in favor of {@link PathChecker#exceedsLength(String)}. The new size
* limit is 1000 chars.
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
int MAX_PATH_LENGTH = 300;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public RelatedResourceEntity(
public abstract void addData(AgObjectId parentId, T object);

/**
* @deprecated since 5.0 in favor of {@link #addData(AgObjectId, Object)}
* @deprecated in favor of {@link #addData(AgObjectId, Object)}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
public void addResult(AgObjectId parentId, T object) {
addData(parentId, object);
}
Expand Down
18 changes: 9 additions & 9 deletions agrest-engine/src/main/java/io/agrest/ResourceEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public Exp getExp() {
/**
* @deprecated in favor of {@link #getExp()}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public Exp getQualifier() {
return getExp();
}
Expand All @@ -155,7 +155,7 @@ public void andExp(Exp exp) {
/**
* @deprecated in favor of {@link #andExp(Exp)}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public void andQualifier(Exp qualifier) {
andExp(qualifier);
}
Expand Down Expand Up @@ -281,7 +281,7 @@ public ResourceEntity<?> getMapBy() {
* @since 1.1
* @deprecated in favor of {@link #mapBy(ResourceEntity)}. mapByPath parameter is ignored.
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public ResourceEntity<T> mapBy(ResourceEntity<?> mapBy, String mapByPath) {
return mapBy(mapBy);
}
Expand All @@ -304,7 +304,7 @@ public int getStart() {
/**
* @deprecated in favor of {@link #getStart()}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public int getFetchOffset() {
return getStart();
}
Expand All @@ -319,7 +319,7 @@ public void setStart(int start) {
/**
* @deprecated in favor of {@link #setStart(int)}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public void setFetchOffset(int fetchOffset) {
setStart(fetchOffset);
}
Expand All @@ -334,7 +334,7 @@ public int getLimit() {
/**
* @deprecated in favor of {@link #getLimit()}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public int getFetchLimit() {
return getLimit();
}
Expand All @@ -349,7 +349,7 @@ public void setLimit(int limit) {
/**
* @deprecated in favor of {@link #setLimit(int)}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public void setFetchLimit(int fetchLimit) {
setLimit(fetchLimit);
}
Expand All @@ -370,15 +370,15 @@ public boolean isFiltered() {
/**
* @deprecated in favor of {@link #getProperty(String)}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public <P> P getRequestProperty(String name) {
return getProperty(name);
}

/**
* @deprecated in favor of {@link #setProperty(String, Object)}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public void setRequestProperty(String name, Object value) {
setProperty(name, value);
}
Expand Down
10 changes: 5 additions & 5 deletions agrest-engine/src/main/java/io/agrest/RootResourceEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
public class RootResourceEntity<T> extends ResourceEntity<T> {

@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
private String applicationBase;
private List<T> data;

Expand Down Expand Up @@ -40,7 +40,7 @@ public List<T> getData() {
/**
* @deprecated in favor of {@link #getData()}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public List<T> getResult() {
return data;
}
Expand All @@ -55,7 +55,7 @@ public void setData(List<T> data) {
/**
* @deprecated in favor of {@link #setData(List)}
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public void setResult(List<T> data) {
this.data = data;
}
Expand All @@ -64,7 +64,7 @@ public void setResult(List<T> data) {
* @since 1.20
* @deprecated as metadata encoding that used this was removed from Agrest
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public String getApplicationBase() {
return applicationBase;
}
Expand All @@ -73,7 +73,7 @@ public String getApplicationBase() {
* @since 1.20
* @deprecated as metadata encoding that used this was removed from Agrest
*/
@Deprecated(since = "5.0")
@Deprecated(since = "5.0", forRemoval = true)
public void setApplicationBase(String applicationBase) {
this.applicationBase = applicationBase;
}
Expand Down
10 changes: 5 additions & 5 deletions agrest-engine/src/main/java/io/agrest/SelectBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,22 @@ default <A> SelectBuilder<T> filter(Class<A> entityType, ReadFilter<A> filter) {
SelectBuilder<T> start(int start);

/**
* @since 1.2
* @since 5.0
*/
SelectBuilder<T> limit(int limit);

/**
* @deprecated since 5.0 in favor of {@link #start(int)} to match the name of the Ag protocol parameter.
* @deprecated in favor of {@link #start(int)} to match the name of the Ag protocol parameter.
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
default SelectBuilder<T> fetchOffset(int offset) {
return start(offset);
}

/**
* @deprecated since 5.0 in favor of {@link #limit(int)} to match the name of the Ag protocol parameter.
* @deprecated in favor of {@link #limit(int)} to match the name of the Ag protocol parameter.
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
default SelectBuilder<T> fetchLimit(int limit) {
return limit(limit);
}
Expand Down
12 changes: 6 additions & 6 deletions agrest-engine/src/main/java/io/agrest/ToManyResourceEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public Map<AgObjectId, List<T>> getDataByParent() {
}

/**
* @deprecated since 5.0 in favor of {@link #getDataByParent()}
* @deprecated in favor of {@link #getDataByParent()}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
public Map<AgObjectId, List<T>> getResultsByParent() {
return getDataByParent();
}
Expand All @@ -44,9 +44,9 @@ public List<T> getData(AgObjectId parentId) {
}

/**
* @deprecated since 5.0 in favor of {@link #getData(AgObjectId)}
* @deprecated in favor of {@link #getData(AgObjectId)}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
public List<T> getResult(AgObjectId parentId) {
return getData(parentId);
}
Expand All @@ -73,9 +73,9 @@ public void setData(AgObjectId parentId, List<T> data) {
}

/**
* @deprecated since 5.0 in favor of {@link #setData(AgObjectId, List)}
* @deprecated in favor of {@link #setData(AgObjectId, List)}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
public void addResultList(AgObjectId parentId, List<T> objects) {
setData(parentId, objects);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public Map<AgObjectId, T> getDataByParent() {
}

/**
* @deprecated since 5.0 in favor of {@link #getDataByParent()}
* @deprecated in favor of {@link #getDataByParent()}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
public Map<AgObjectId, T> getResultsByParent() {
return getDataByParent();
}
Expand All @@ -43,9 +43,9 @@ public T getData(AgObjectId parentId) {
}

/**
* @deprecated since 5.0 in favor of {@link #getData(AgObjectId)}
* @deprecated in favor of {@link #getData(AgObjectId)}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
public T getResult(AgObjectId parentId) {
return getData(parentId);
}
Expand Down
8 changes: 4 additions & 4 deletions agrest-engine/src/main/java/io/agrest/UpdateBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ public interface UpdateBuilder<T> {
UpdateBuilder<T> byId(Object id);

/**
* @deprecated since 5.0 in favor of {@link #byId(Object)}
* @deprecated in favor of {@link #byId(Object)}
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
default UpdateBuilder<T> id(Object id) {
return byId(id);
}

/**
* @deprecated since 5.0 in favor of {@link #byId(Object)}.
* @deprecated in favor of {@link #byId(Object)}.
*/
@Deprecated
@Deprecated(since = "5.0", forRemoval = true)
default UpdateBuilder<T> id(Map<String, Object> id) {
return byId(id);
}
Expand Down
Loading

0 comments on commit d55b0d4

Please sign in to comment.