public static IIdType applyETagAsVersion(RequestDetails theRequest, IIdType id) { String ifMatchValue = theRequest.getHeader(Constants.HEADER_IF_MATCH); if (isNotBlank(ifMatchValue)) { ifMatchValue = ParameterUtil.parseETagValue(ifMatchValue); if (id != null && id.hasVersionIdPart() == false) { id = id.withVersion(ifMatchValue); } } return id; }
void incrementId(T theResource, ResourceTable theSavedEntity, IIdType theResourceId) { String newVersion; long newVersionLong; if (theResourceId == null || theResourceId.getVersionIdPart() == null) { newVersion = "1"; newVersionLong = 1; } else { newVersionLong = theResourceId.getVersionIdPartAsLong() + 1; newVersion = Long.toString(newVersionLong); } IIdType newId = theResourceId.withVersion(newVersion); theResource.getIdElement().setValue(newId.getValue()); theSavedEntity.setVersion(newVersionLong); }
if (existing == null || existing.isEmpty()) { if (theRequestedId != null) { theRequestedId.withVersion(eTagVersion).applyTo(resource);
res.setId(value.getValueAsString()); if (isNotBlank(versionId) && res.getIdElement().hasVersionIdPart() == false) { res.setId(res.getIdElement().withVersion(versionId));
res.setId(value.getValueAsString()); if (isNotBlank(versionId) && res.getIdElement().hasVersionIdPart() == false) { res.setId(res.getIdElement().withVersion(versionId));
theResourceId = theResourceId.withVersion(Long.toString(savedEntity.getVersion()));
res.setId(res.getIdElement().withVersion(theVersion.toString()));
public static IIdType applyETagAsVersion(RequestDetails theRequest, IIdType id) { String ifMatchValue = theRequest.getHeader(Constants.HEADER_IF_MATCH); if (isNotBlank(ifMatchValue)) { ifMatchValue = ParameterUtil.parseETagValue(ifMatchValue); if (id != null && id.hasVersionIdPart() == false) { id = id.withVersion(ifMatchValue); } } return id; }
void incrementId(T theResource, ResourceTable theSavedEntity, IIdType theResourceId) { String newVersion; long newVersionLong; if (theResourceId == null || theResourceId.getVersionIdPart() == null) { newVersion = "1"; newVersionLong = 1; } else { newVersionLong = theResourceId.getVersionIdPartAsLong() + 1; newVersion = Long.toString(newVersionLong); } IIdType newId = theResourceId.withVersion(newVersion); theResource.getIdElement().setValue(newId.getValue()); theSavedEntity.setVersion(newVersionLong); }
if (existing == null || existing.isEmpty()) { if (theRequestedId != null) { theRequestedId.withVersion(eTagVersion).applyTo(resource);
res.setId(value.getValueAsString()); if (isNotBlank(versionId) && res.getIdElement().hasVersionIdPart() == false) { res.setId(res.getIdElement().withVersion(versionId));
res.setId(value.getValueAsString()); if (isNotBlank(versionId) && res.getIdElement().hasVersionIdPart() == false) { res.setId(res.getIdElement().withVersion(versionId));
theResourceId = theResourceId.withVersion(Long.toString(savedEntity.getVersion()));
res.setId(res.getIdElement().withVersion(theVersion.toString()));