Skip to content

Commit

Permalink
RObjectReference: param name fixes in copyToJAXB methods
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jun 11, 2020
1 parent 797cfa8 commit 838dc96
Showing 1 changed file with 15 additions and 14 deletions.
Expand Up @@ -190,25 +190,26 @@ public String toString() {
+ '}';
}

public static void copyToJAXB(RObjectReference repo, ObjectReferenceType jaxb) {
Validate.notNull(repo, "Repo object must not be null.");
Validate.notNull(jaxb, "JAXB object must not be null.");
public static void copyToJAXB(RObjectReference<?> repoObject, ObjectReferenceType jaxbObject) {
Validate.notNull(repoObject, "Repo object must not be null.");
Validate.notNull(jaxbObject, "JAXB object must not be null.");

jaxb.setType(ClassMapper.getQNameForHQLType(repo.getTargetType()));
jaxb.setOid(repo.getTargetOid());
jaxb.setRelation(RUtil.stringToQName(repo.getRelation()));
jaxbObject.setType(ClassMapper.getQNameForHQLType(repoObject.getTargetType()));
jaxbObject.setOid(repoObject.getTargetOid());
jaxbObject.setRelation(RUtil.stringToQName(repoObject.getRelation()));
}

public static ObjectReference copyFromJAXB(ObjectReferenceType jaxb, ObjectReference repo, RelationRegistry relationRegistry) {
Validate.notNull(repo, "Repo object must not be null.");
Validate.notNull(jaxb, "JAXB object must not be null.");
Validate.notEmpty(jaxb.getOid(), "Target oid must not be null.");
public static ObjectReference copyFromJAXB(
ObjectReferenceType jaxbObject, ObjectReference repoObject, RelationRegistry relationRegistry) {
Validate.notNull(repoObject, "Repo object must not be null.");
Validate.notNull(jaxbObject, "JAXB object must not be null.");
Validate.notEmpty(jaxbObject.getOid(), "Target oid must not be null.");

repo.setTargetType(ClassMapper.getHQLTypeForQName(jaxb.getType()));
repo.setRelation(qnameToString(relationRegistry.normalizeRelation(jaxb.getRelation())));
repo.setTargetOid(jaxb.getOid());
repoObject.setTargetType(ClassMapper.getHQLTypeForQName(jaxbObject.getType()));
repoObject.setRelation(qnameToString(relationRegistry.normalizeRelation(jaxbObject.getRelation())));
repoObject.setTargetOid(jaxbObject.getOid());

return repo;
return repoObject;
}

public ObjectReferenceType toJAXB(PrismContext prismContext) {
Expand Down

0 comments on commit 838dc96

Please sign in to comment.