本文整理了Java中ca.uhn.fhir.util.ObjectUtil
类的一些代码示例,展示了ObjectUtil
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectUtil
类的具体详情如下:
包路径:ca.uhn.fhir.util.ObjectUtil
类名称:ObjectUtil
暂无
代码示例来源:origin: jamesagnew/hapi-fhir
/**
* Returns the first tag (if any) that has the given system and code, or returns
* <code>null</code> if none
*/
public Coding getTag(String theSystem, String theCode) {
for (Coding next : getTag()) {
if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
return next;
}
}
return null;
}
代码示例来源:origin: jamesagnew/hapi-fhir
public static IValidationContext<IBaseResource> forText(final FhirContext theContext, final String theResourceBody) {
ObjectUtil.requireNonNull(theContext, "theContext can not be null");
ObjectUtil.requireNotEmpty(theResourceBody, "theResourceBody can not be null or empty");
return new BaseValidationContext<IBaseResource>(theContext) {
代码示例来源:origin: jamesagnew/hapi-fhir
@Override
public void addValidationMessage(SingleValidationMessage theMessage) {
ObjectUtil.requireNonNull(theMessage, "theMessage must not be null");
myMessages.add(theMessage);
}
代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-base
@Override
public void addValidationMessage(SingleValidationMessage theMessage) {
ObjectUtil.requireNonNull(theMessage, "theMessage must not be null");
myMessages.add(theMessage);
}
代码示例来源:origin: jamesagnew/hapi-fhir
/**
* Returns the first security label (if any) that has the given system and code, or returns
* <code>null</code> if none
*/
public Coding getSecurity(String theSystem, String theCode) {
for (Coding next : getTag()) {
if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
return next;
}
}
return null;
}
代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-base
public static IValidationContext<IBaseResource> forText(final FhirContext theContext, final String theResourceBody) {
ObjectUtil.requireNonNull(theContext, "theContext can not be null");
ObjectUtil.requireNotEmpty(theResourceBody, "theResourceBody can not be null or empty");
return new BaseValidationContext<IBaseResource>(theContext) {
代码示例来源:origin: jamesagnew/hapi-fhir
/**
* Returns the first security label (if any) that has the given system and code, or returns
* <code>null</code> if none
*/
public CodingDt getSecurity(String theSystem, String theCode) {
for (CodingDt next : getTag()) {
if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
return next;
}
}
return null;
}
代码示例来源:origin: jamesagnew/hapi-fhir
/**
* Returns the first tag (if any) that has the given system and code, or returns
* <code>null</code> if none
*/
public Coding getTag(String theSystem, String theCode) {
for (Coding next : getTag()) {
if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
return next;
}
}
return null;
}
代码示例来源:origin: jamesagnew/hapi-fhir
/**
* Returns the first tag (if any) that has the given system and code, or returns
* <code>null</code> if none
*/
public Coding getTag(String theSystem, String theCode) {
for (Coding next : getTag()) {
if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
return next;
}
}
return null;
}
代码示例来源:origin: jamesagnew/hapi-fhir
/**
* Returns the first tag (if any) that has the given system and code, or returns
* <code>null</code> if none
*/
public CodingDt getTag(String theSystem, String theCode) {
for (CodingDt next : getTag()) {
if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
return next;
}
}
return null;
}
代码示例来源:origin: jamesagnew/hapi-fhir
/**
* Returns the first security label (if any) that has the given system and code, or returns
* <code>null</code> if none
*/
public Coding getSecurity(String theSystem, String theCode) {
for (Coding next : getTag()) {
if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
return next;
}
}
return null;
}
protected void listChildren(List<Property> childrenList) {
代码示例来源:origin: jamesagnew/hapi-fhir
/**
* Returns the first security label (if any) that has the given system and code, or returns
* <code>null</code> if none
*/
public Coding getSecurity(String theSystem, String theCode) {
for (Coding next : getTag()) {
if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
return next;
}
}
return null;
}
protected void listChildren(List<Property> children) {
代码示例来源:origin: jamesagnew/hapi-fhir
private <MT extends IBaseMetaType> void doMetaDelete(MT theMetaDel, BaseHasResource entity) {
List<TagDefinition> tags = toTagList(theMetaDel);
//@formatter:off
for (TagDefinition nextDef : tags) {
for (BaseTag next : new ArrayList<BaseTag>(entity.getTags())) {
if (ObjectUtil.equals(next.getTag().getTagType(), nextDef.getTagType()) &&
ObjectUtil.equals(next.getTag().getSystem(), nextDef.getSystem()) &&
ObjectUtil.equals(next.getTag().getCode(), nextDef.getCode())) {
myEntityManager.remove(next);
entity.getTags().remove(next);
}
}
}
//@formatter:on
if (entity.getTags().isEmpty()) {
entity.setHasTags(false);
}
myEntityManager.merge(entity);
}
代码示例来源:origin: jamesagnew/hapi-fhir
@Override
public void addTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm, String theLabel) {
StopWatch w = new StopWatch();
BaseHasResource entity = readEntity(theId);
if (entity == null) {
throw new ResourceNotFoundException(theId);
}
for (BaseTag next : new ArrayList<>(entity.getTags())) {
if (ObjectUtil.equals(next.getTag().getTagType(), theTagType) &&
ObjectUtil.equals(next.getTag().getSystem(), theScheme) &&
ObjectUtil.equals(next.getTag().getCode(), theTerm)) {
return;
}
}
entity.setHasTags(true);
TagDefinition def = getTagOrNull(TagTypeEnum.TAG, theScheme, theTerm, theLabel);
if (def != null) {
BaseTag newEntity = entity.addTag(def);
if (newEntity.getTagId() == null) {
myEntityManager.persist(newEntity);
myEntityManager.merge(entity);
}
}
ourLog.debug("Processed addTag {}/{} on {} in {}ms", theScheme, theTerm, theId, w.getMillisAndRestart());
}
代码示例来源:origin: jamesagnew/hapi-fhir
@Override
public void removeTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm, RequestDetails theRequestDetails) {
// Notify interceptors
if (theRequestDetails != null) {
ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theId);
notifyInterceptors(RestOperationTypeEnum.DELETE_TAGS, requestDetails);
}
StopWatch w = new StopWatch();
BaseHasResource entity = readEntity(theId);
if (entity == null) {
throw new ResourceNotFoundException(theId);
}
for (BaseTag next : new ArrayList<>(entity.getTags())) {
if (ObjectUtil.equals(next.getTag().getTagType(), theTagType) &&
ObjectUtil.equals(next.getTag().getSystem(), theScheme) &&
ObjectUtil.equals(next.getTag().getCode(), theTerm)) {
myEntityManager.remove(next);
entity.getTags().remove(next);
}
}
if (entity.getTags().isEmpty()) {
entity.setHasTags(false);
}
myEntityManager.merge(entity);
ourLog.debug("Processed remove tag {}/{} on {} in {}ms", theScheme, theTerm, theId.getValue(), w.getMillisAndRestart());
}
代码示例来源:origin: jamesagnew/hapi-fhir
private <MT extends IBaseMetaType> void doMetaAdd(MT theMetaAdd, BaseHasResource entity) {
List<TagDefinition> tags = toTagList(theMetaAdd);
for (TagDefinition nextDef : tags) {
boolean hasTag = false;
for (BaseTag next : new ArrayList<>(entity.getTags())) {
if (ObjectUtil.equals(next.getTag().getTagType(), nextDef.getTagType()) &&
ObjectUtil.equals(next.getTag().getSystem(), nextDef.getSystem()) &&
ObjectUtil.equals(next.getTag().getCode(), nextDef.getCode())) {
hasTag = true;
break;
}
}
if (!hasTag) {
entity.setHasTags(true);
TagDefinition def = getTagOrNull(nextDef.getTagType(), nextDef.getSystem(), nextDef.getCode(), nextDef.getDisplay());
if (def != null) {
BaseTag newEntity = entity.addTag(def);
if (newEntity.getTagId() == null) {
myEntityManager.persist(newEntity);
}
}
}
}
validateMetaCount(entity.getTags().size());
myEntityManager.merge(entity);
}
代码示例来源:origin: jamesagnew/hapi-fhir
boolean found = false;
for (Coding item : list) {
if (ObjectUtil.equals(item.getSystem(), system) && ObjectUtil.equals(item.getCode(), code)) {
found = true;
break;
代码示例来源:origin: jamesagnew/hapi-fhir
boolean found = false;
for (Coding item : list) {
if (ObjectUtil.equals(item.getSystem(), system) && ObjectUtil.equals(item.getCode(), code)) {
found = true;
break;
代码示例来源:origin: jamesagnew/hapi-fhir
myCodeSystemDao.save(codeSystem);
} else {
if (!ObjectUtil.equals(codeSystem.getResource().getId(), theCodeSystemVersion.getResource().getId())) {
String msg = myContext.getLocalizer().getMessage(BaseHapiTerminologySvcImpl.class, "cannotCreateDuplicateCodeSystemUri", theSystemUri,
codeSystem.getResource().getIdDt().toUnqualifiedVersionless().getValue());
代码示例来源:origin: jamesagnew/hapi-fhir
boolean found = false;
for (Coding item : list) {
if (ObjectUtil.equals(item.getSystem(), system) && ObjectUtil.equals(item.getCode(), code)) {
found = true;
break;
内容来源于网络,如有侵权,请联系作者删除!