com.nedap.archie.rm.demographic.Role 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.demographic;
import com.nedap.archie.rm.support.identification.PartyRef;
import com.nedap.archie.rm.datavalues.quantity.DvInterval;
import com.nedap.archie.rm.datavalues.quantity.datetime.DvDate;
import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import java.util.List;
import java.util.Objects;
/**
* Created by pieter.bos on 08/07/16.
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name="ROLE", propOrder = {
"capabilities",
"timeValidity",
"performer"
})
public class Role extends Party {
@Nullable
@XmlElement(name="time_validity")
private DvInterval timeValidity;
private PartyRef performer;
@Nullable
private List capabilities;
@Nullable
public DvInterval getTimeValidity() {
return timeValidity;
}
public void setTimeValidity(@Nullable DvInterval timeValidity) {
this.timeValidity = timeValidity;
}
public PartyRef getPerformer() {
return performer;
}
public void setPerformer(PartyRef performer) {
this.performer = performer;
}
@Nullable
public List getCapabilities() {
return capabilities;
}
public void setCapabilities(@Nullable List capabilities) {
this.capabilities = capabilities;
this.setThisAsParent(capabilities, "capabilities");
}
public void addCapability(Capability capability) {
this.capabilities.add(capability);
this.setThisAsParent(capability, "capabilities");
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
Role role = (Role) o;
return Objects.equals(timeValidity, role.timeValidity) &&
Objects.equals(performer, role.performer) &&
Objects.equals(capabilities, role.capabilities);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), timeValidity, performer, capabilities);
}
}