Skip to content

Commit

Permalink
BFD-3179: Applied lombok annotations where possible under bfd-model (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rcrupp authored Jan 18, 2024
1 parent d0fed2b commit edd6176
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 578 deletions.
5 changes: 5 additions & 0 deletions apps/bfd-model/bfd-model-codebook-library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;

/**
* Represents the data contained in a <a
* href="https://www.ccwdata.org/web/guest/data-dictionaries">CMS Chronic Conditions Warehouse (CCW)
* data dictionary</a> codebook.
*/
@Getter
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public final class Codebook {
Expand Down Expand Up @@ -54,44 +56,6 @@ public Codebook() {
this.variables = new ArrayList<>();
}

/**
* Gets the {@link #id}.
*
* @return the short identifier for this {@link Codebook}, for use in debugging
*/
public String getId() {
return id;
}

/**
* Gets the {@link #name}.
*
* @return the descriptive English name for this {@link Codebook}
*/
public String getName() {
return name;
}

/**
* Gets the {@link #version}.
*
* @return a human-readable {@link String} that identifies which version of the data is
* represented by this {@link Codebook}, typically something like "<code>
* December 2042, Version 42.0</code>"
*/
public String getVersion() {
return version;
}

/**
* Gets the {@link #variables}.
*
* @return the mutable {@link List} of {@link Variable}s in the {@link Codebook}
*/
public List<Variable> getVariables() {
return variables;
}

/** {@inheritDoc} */
@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlValue;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
* Each {@link Value} instance in a {@link ValueGroup} represents one of the allowed coded values
Expand All @@ -12,6 +16,10 @@
* <p>Note that only some {@link Variable}s are coded, and only some of those coded {@link
* Variable}s have their possible {@link Value}s enumerated in the {@link Codebook}.
*/
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@XmlAccessorType(XmlAccessType.PROPERTY)
public final class Value {

Expand All @@ -24,24 +32,6 @@ public final class Value {
/** A brief English human-readable description of this {@link Value}. */
private String description;

/** Constructs a new {@link Value} instance. */
public Value() {
this.code = null;
this.description = null;
}

/**
* Constructs a new {@link Value} instance for the CCWCodebookMissingVariable. Had to add new
* constructor for instantiation of the CCWCodebookInterface
*
* @param code the code
* @param description the description
*/
public Value(String code, String description) {
this.code = code;
this.description = description;
}

/**
* Gets the code.
*
Expand All @@ -53,15 +43,6 @@ public String getCode() {
return code;
}

/**
* Sets the code.
*
* @param code the new value for {@link #getCode()}
*/
public void setCode(String code) {
this.code = code;
}

/**
* Gets the description.
*
Expand All @@ -71,25 +52,4 @@ public void setCode(String code) {
public String getDescription() {
return description;
}

/**
* Sets the description.
*
* @param description the new value for {@link #getDescription()}
*/
public void setDescription(String description) {
this.description = description;
}

/** {@inheritDoc} */
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("Value [code=");
builder.append(code);
builder.append(", description=");
builder.append(description);
builder.append("]");
return builder.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@
import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.ArrayList;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Setter;

/**
* Represents a grouped {@link List} of {@link Value}s in a {@link Variable}. These {@link
* ValueGroup}ings are only used to associate a common {@link #getDescription()} value with related
* {@link Variable}s.
* ValueGroup}ings are only used to associate a common getDescription() value with related {@link
* Variable}s.
*
* <p>Note that many {@link ValueGroup}s do not have a description. This is the case for {@link
* Variable}s that only have a single {@link ValueGroup}.
*
* <p>Note that only some {@link Variable}s are coded, and only some of those coded {@link
* Variable}s have their possible {@link Value}s enumerated in the {@link Codebook}. For {@link
* Variable}s that don't have their possible {@link Value}s enumerated in the {@link Codebook}, the
* {@link Variable#getValueGroups()} property will be <code>null</code>.
* Variable.getValueGroups() property will be <code>null</code>.
*/
@Setter
@AllArgsConstructor
@XmlAccessorType(XmlAccessType.PROPERTY)
public final class ValueGroup {
/**
Expand All @@ -38,18 +42,6 @@ public ValueGroup() {
this.values = new ArrayList<>();
}

/**
* Constructs a new {@link ValueGroup} instance for the CCWCodebookMissingVariable. Had to add new
* constructor for instantiation of the CCWCodebookInterface
*
* @param description the description
* @param values the values
*/
public ValueGroup(List<String> description, List<Value> values) {
this.description = description;
this.values = values;
}

/**
* Gets the {@link #description}.
*
Expand All @@ -64,15 +56,6 @@ public List<String> getDescription() {
return description;
}

/**
* Sets the {@link #description}.
*
* @param description the new value to use for {@link #getDescription()}
*/
public void setDescription(List<String> description) {
this.description = description;
}

/**
* Gets the {@link #values}.
*
Expand Down
Loading

0 comments on commit edd6176

Please sign in to comment.