Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repo-sqale: modifyObject updates fullObject (not attributes yet)
- Loading branch information
Showing
14 changed files
with
191 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
repo/repo-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/SqaleUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (C) 2010-2021 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.repo.sqale; | ||
|
||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
|
||
public class SqaleUtils { | ||
|
||
/** | ||
* Returns version from midPoint object as a number. | ||
* Returns 0 for any non-number version, never returns null. | ||
*/ | ||
public static int objectVersionAsInt(ObjectType schemaObject) { | ||
String version = schemaObject.getVersion(); | ||
if (version != null) { | ||
try { | ||
return Integer.parseInt(version); | ||
} catch (NumberFormatException e) { | ||
// ignorable, version will be 0 | ||
} | ||
} | ||
return 0; | ||
} | ||
|
||
/** | ||
* Returns version from prism object as a number. | ||
* Returns 0 for any non-number version, never returns null. | ||
*/ | ||
public static int objectVersionAsInt(PrismObject<?> prismObject) { | ||
String version = prismObject.getVersion(); | ||
if (version != null) { | ||
try { | ||
return Integer.parseInt(version); | ||
} catch (NumberFormatException e) { | ||
// ignorable, version will be 0 | ||
} | ||
} | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.