Commit a4f536c8 authored by Anastasios Poimenidis's avatar Anastasios Poimenidis
Browse files

fix: make @ToString and @EqualsAndHashCode use minimal values

parent aaadd77e
Loading
Loading
Loading
Loading
+8 −4
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/agreement/schema/Agreement.java: 8 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -29,8 +29,10 @@ import jakarta.validation.constraints.NotNull;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.etsi.osl.hypo.api.tmf.common.schema.AgreementRef;
import org.etsi.osl.hypo.api.tmf.common.schema.RelatedPartyEntity;
import org.etsi.osl.hypo.api.tmf.common.schema.ValidFor;
@@ -43,11 +45,13 @@ import org.etsi.osl.hypo.api.tmf.party.partnership.management.schema.AgreementSp
 * involves a number of other business entities, such as products, services, and resources and/or
 * their specifications.
 */
@Data
@Getter
@Setter
@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
@ToString(callSuper = true, onlyExplicitlyIncluded = true)
@Entity(name = "Agreement")
@Table(name = "Agreement")
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = false)
@JsonPropertyOrder({
    "id",
    "@baseType",
@@ -79,7 +83,7 @@ public class Agreement extends BaseFieldsEntityWithHref {

    private OffsetDateTime initialDate;

    private String name;
    @EqualsAndHashCode.Include @ToString.Include private String name;

    private String statementOfIntent;

+8 −4
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/agreement/schema/AgreementAuthorization.java: 8 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -17,16 +17,20 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import java.time.OffsetDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.etsi.osl.hypo.api.tmf.common.model.BaseFieldsEntity;

/** A business participant that is responsible for approving the agreement. */
@Data
@Getter
@Setter
@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
@ToString(callSuper = true, onlyExplicitlyIncluded = true)
@Entity(name = "AgreementAuthorization")
@Table(name = "AgreementAuthorization")
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = false)
@JsonPropertyOrder({
    "id",
    "@baseType",
@@ -41,7 +45,7 @@ public class AgreementAuthorization extends BaseFieldsEntity {

    private OffsetDateTime date;

    private String signatureRepresentation;
    @ToString.Include @EqualsAndHashCode.Include private String signatureRepresentation;

    private String state;
}
+7 −3
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/agreement/schema/AgreementItem.java: 7 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -24,8 +24,10 @@ import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.etsi.osl.hypo.api.tmf.common.model.BaseFieldsEntity;
import org.etsi.osl.hypo.api.tmf.common.schema.product.ProductOfferingRef;
import org.etsi.osl.hypo.api.tmf.product.order.schema.ProductRef;
@@ -34,11 +36,13 @@ import org.etsi.osl.hypo.api.tmf.product.order.schema.ProductRef;
 * A part of the agreement expressed in terms of a product offering and possibly including specific
 * terms and conditions.
 */
@Data
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Entity(name = "AgreementItem")
@Table(name = "AgreementItem")
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = false)
@JsonPropertyOrder({
    "id",
    "@baseType",
+8 −4
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/agreement/schema/AgreementSpecCharacteristic.java: 8 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -24,17 +24,21 @@ import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.etsi.osl.hypo.api.tmf.common.model.BaseFieldsEntity;
import org.etsi.osl.hypo.api.tmf.common.schema.ValidFor;

/** A characteristic quality or distinctive feature of an agreement. */
@Data
@Getter
@Setter
@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
@ToString(callSuper = true, onlyExplicitlyIncluded = true)
@Entity(name = "AgreementSpecCharacteristic")
@Table(name = "AgreementSpecCharacteristic")
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = false)
@JsonPropertyOrder({
    "id",
    "@baseType",
@@ -54,7 +58,7 @@ public class AgreementSpecCharacteristic extends BaseFieldsEntity {

    private String description;

    private String name;
    @EqualsAndHashCode.Include @ToString.Include private String name;

    private String valueType;

+10 −4
Changes for src/main/java/org/etsi/osl/hypo/api/tmf/agreement/schema/AgreementSpecCharacteristicValue.java: 10 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -13,20 +13,25 @@
package org.etsi.osl.hypo.api.tmf.agreement.schema;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.etsi.osl.hypo.api.tmf.common.model.BaseFieldsEntity;
import org.etsi.osl.hypo.api.tmf.common.schema.ValidFor;

/** A number or text that can be assigned to an agreement specification characteristic. */
@Data
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Entity(name = "AgreementSpecCharacteristicValue")
@Table(name = "AgreementSpecCharacteristicValue")
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = false)
@JsonPropertyOrder({
    "id",
    "@baseType",
@@ -41,7 +46,8 @@ import org.etsi.osl.hypo.api.tmf.common.schema.ValidFor;
    "value"
})
public class AgreementSpecCharacteristicValue extends BaseFieldsEntity {
    private Boolean _default;
    @JsonProperty("_default")
    private Boolean defaultValue;

    private String unitOfMeasure;

Loading