com.nedap.archie.rm.datavalues.DvParagraph Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openehr-rm Show documentation
Show all versions of openehr-rm Show documentation
An implementation of the openehr reference model
package com.nedap.archie.rm.datavalues;
/**
* Created by pieter.bos on 08/07/16.
*/
import com.nedap.archie.rminfo.Invariant;
import com.nedap.archie.rmutil.InvariantUtil;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DV_PARAGRAPH")
@Deprecated
public class DvParagraph extends DataValue {
private List items = new ArrayList<>();
public List getItems() {
return items;
}
public void setItems(List items) {
this.items = items;
}
public void addItem(DvText item) {
this.items.add(item);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DvParagraph that = (DvParagraph) o;
return Objects.equals(items, that.items);
}
@Override
public int hashCode() {
return Objects.hash(items);
}
@Invariant(value = "Items_valid", ignored = true)
public boolean itemsValid() {
return InvariantUtil.nullOrNotEmpty(items);
}
}