-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Team ID fix in Schedule and Policy importer (#57)
* fixed the schedule and policy importer updating team id * updating the build versions to 23.9
- Loading branch information
1 parent
0506fc7
commit 356ab17
Showing
10 changed files
with
97 additions
and
13 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
40 changes: 40 additions & 0 deletions
40
backup-commons/src/main/java/com/opsgenie/tools/backup/util/OptionalUtil.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,40 @@ | ||
package com.opsgenie.tools.backup.util; | ||
|
||
public class OptionalUtil<T> { | ||
private final T value; | ||
private static final OptionalUtil<?> EMPTY = new OptionalUtil(); | ||
|
||
private OptionalUtil() { | ||
this.value = null; | ||
} | ||
|
||
private OptionalUtil(T value) { | ||
this.value = value; | ||
} | ||
|
||
public static<T> OptionalUtil<T> empty() { | ||
return (OptionalUtil<T>) EMPTY; | ||
} | ||
|
||
public static <T> OptionalUtil<T> of(T value) { | ||
if (value == null) { | ||
throw new NullPointerException("Value cannot be null"); | ||
} | ||
return new OptionalUtil<T>(value); | ||
} | ||
|
||
public T get() { | ||
if (value == null) { | ||
throw new IllegalStateException("Value is not present"); | ||
} | ||
return value; | ||
} | ||
|
||
public boolean isPresent() { | ||
return value != null; | ||
} | ||
|
||
public T orElse(T defaultValue) { | ||
return value != null ? value : defaultValue; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
group 'com.opsgenie.tools' | ||
version '0.23.8' | ||
version '0.23.9' | ||
|
||
apply plugin: '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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
group 'com.opsgenie.tools' | ||
version '0.23.8' | ||
version '0.23.9' | ||
|
||
apply plugin: '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
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