Skip to content

Commit

Permalink
Remove deprecated targetEntityType
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus-87 committed Jun 21, 2022
1 parent 2542fd7 commit 36f6573
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"lastPublished" : "2021-12-24T12:00:00",
"primary" : true,
"slug" : "foobar",
"targetEntityType" : "COLLECTION",
"targetIdentifiableObjectType" : "COLLECTION",
"targetIdentifiableType" : "ENTITY",
"targetLanguage" : "de",
Expand All @@ -17,6 +16,7 @@
"type" : "ENTITY",
"refId" : 0,
"entityType" : "WEBSITE"
}
},
"targetEntityType" : "COLLECTION"
} ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"lastPublished" : "2021-12-24T12:00:00",
"primary" : true,
"slug" : "foobar",
"targetEntityType" : "COLLECTION",
"targetIdentifiableObjectType" : "COLLECTION",
"targetIdentifiableType" : "ENTITY",
"targetLanguage" : "de",
Expand All @@ -16,5 +15,6 @@
"type" : "ENTITY",
"refId" : 0,
"entityType" : "WEBSITE"
}
},
"targetEntityType" : "COLLECTION"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public static Builder builder() {
private LocalDateTime lastPublished;
private boolean primary;
private String slug;
private EntityType targetEntityType;
private IdentifiableObjectType targetIdentifiableObjectType;
private IdentifiableType targetIdentifiableType;
private Locale targetLanguage;
Expand All @@ -50,7 +49,6 @@ public boolean equals(Object obj) {
&& Objects.equals(this.targetLanguage, other.targetLanguage)
&& Objects.equals(this.targetIdentifiableObjectType, other.targetIdentifiableObjectType)
&& Objects.equals(this.targetIdentifiableType, other.targetIdentifiableType)
&& Objects.equals(this.targetEntityType, other.targetEntityType)
&& Objects.equals(this.targetUuid, other.targetUuid)
&& Objects.equals(this.uuid, other.uuid)
&& Objects.equals(
Expand Down Expand Up @@ -157,11 +155,6 @@ public void setSlug(String slug) {
this.slug = slug;
}

@Deprecated(forRemoval = true, since = "10.0.0")
public void setTargetEntityType(EntityType targetEntityType) {
this.targetEntityType = targetEntityType;
}

public void setTargetIdentifiableObjectType(IdentifiableObjectType targetIdentifiableObjectType) {
this.targetIdentifiableObjectType = targetIdentifiableObjectType;
}
Expand Down Expand Up @@ -198,8 +191,6 @@ public String toString() {
+ ", slug='"
+ slug
+ '\''
+ ", targetEntityType="
+ targetEntityType
+ ", targetIdentifiableObjectType="
+ targetIdentifiableObjectType
+ ", targetIdentifiableType="
Expand Down Expand Up @@ -254,12 +245,9 @@ public Builder targetLanguage(String targetLanguage) {
}

public Builder targetType(
IdentifiableObjectType identifiableObjectType,
IdentifiableType identifiableType,
EntityType entityType) {
IdentifiableObjectType identifiableObjectType, IdentifiableType identifiableType) {
urlAlias.setTargetIdentifiableObjectType(identifiableObjectType);
urlAlias.setTargetIdentifiableType(identifiableType);
urlAlias.setTargetEntityType(entityType);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class UrlAliasTest {
void fillTargetEntityTypeForColletion() {
UrlAlias urlAlias =
UrlAlias.builder()
.targetType(
IdentifiableObjectType.COLLECTION, IdentifiableType.ENTITY, EntityType.COLLECTION)
.targetType(IdentifiableObjectType.COLLECTION, IdentifiableType.ENTITY)
.build();
assertThat(urlAlias.getTargetEntityType()).isEqualTo(EntityType.COLLECTION);
}
Expand All @@ -27,7 +26,7 @@ void fillTargetEntityTypeForColletion() {
void fillTargetEntityTypeForWebpage() {
UrlAlias urlAlias =
UrlAlias.builder()
.targetType(IdentifiableObjectType.WEBPAGE, IdentifiableType.RESOURCE, null)
.targetType(IdentifiableObjectType.WEBPAGE, IdentifiableType.RESOURCE)
.build();
assertThat(urlAlias.getTargetEntityType()).isNull();
}
Expand All @@ -37,7 +36,7 @@ void fillTargetEntityTypeForWebpage() {
void fillTargetEntityTypeForFamily() {
UrlAlias urlAlias =
UrlAlias.builder()
.targetType(IdentifiableObjectType.FAMILY, IdentifiableType.ENTITY, EntityType.FAMILY)
.targetType(IdentifiableObjectType.FAMILY, IdentifiableType.ENTITY)
.build();
assertThat(urlAlias.getTargetEntityType()).isEqualTo(EntityType.FAMILY);
}
Expand All @@ -47,8 +46,7 @@ void fillTargetEntityTypeForFamily() {
void fillTargetEntityTypeForFileResource() {
UrlAlias urlAlias =
UrlAlias.builder()
.targetType(
IdentifiableObjectType.APPLICATION_FILE_RESOURCE, IdentifiableType.RESOURCE, null)
.targetType(IdentifiableObjectType.APPLICATION_FILE_RESOURCE, IdentifiableType.RESOURCE)
.build();
assertThat(urlAlias.getTargetEntityType()).isNull();
}
Expand All @@ -58,10 +56,7 @@ void fillTargetEntityTypeForFileResource() {
void fillTargetEntityTypeForHumanSettlement() {
UrlAlias urlAlias =
UrlAlias.builder()
.targetType(
IdentifiableObjectType.HUMAN_SETTLEMENT,
IdentifiableType.ENTITY,
EntityType.GEOLOCATION)
.targetType(IdentifiableObjectType.HUMAN_SETTLEMENT, IdentifiableType.ENTITY)
.build();
assertThat(urlAlias.getTargetEntityType()).isEqualTo(EntityType.GEOLOCATION);
}
Expand Down

0 comments on commit 36f6573

Please sign in to comment.