Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc29a3f7

Browse files
committed
Merge branch 'develop'
2 parents5a59b72 +2240fee commitc29a3f7

File tree

3 files changed

+57
-2
lines changed

3 files changed

+57
-2
lines changed

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ This is a collection of classes, that makes it easy to access the [utPLSQL v3](h
1111

1212
This is a Maven Library project, you can add on your Java project as a dependency.
1313

14+
*Notice: You no longer need to configure an additional repository. The library is available in Maven Central since version 3.1.15.*
15+
1416
```xml
1517
<dependency>
1618
<groupId>org.utplsql</groupId>
1719
<artifactId>utplsql-java-api</artifactId>
18-
<version>3.1.10</version>
20+
<version>3.1.16</version>
1921
</dependency>
2022
```
2123

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>org.utplsql</groupId>
66
<artifactId>utplsql-java-api</artifactId>
7-
<version>3.1.15</version>
7+
<version>3.1.16</version>
88

99
<name>utPLSQL Java API</name>
1010
<description>Java API for running Unit Tests with utPLSQL v3+.</description>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
packageorg.utplsql.api;
2+
3+
importjavax.annotation.Nullable;
4+
5+
/**
6+
* This class provides an easy way to get environmental variables.
7+
* This is mainly to improve testability but also to standardize the way how utPLSQL API and CLI read from
8+
* environment.
9+
* <p>
10+
* Variables are obtained from the following scopes in that order (chain breaks as soon as a value is obtained):
11+
* <ul>
12+
* <li>Properties (System.getProperty())</li>
13+
* <li>Environment (System.getEnv())</li>
14+
* <li>Default value</li>
15+
* </ul>
16+
* <p>
17+
* An empty string is treated the same as null.
18+
*
19+
* @author pesse
20+
*/
21+
publicclassEnvironmentVariableUtil {
22+
23+
privateEnvironmentVariableUtil() {
24+
}
25+
26+
/**
27+
* Returns the value for a given key from environment (see class description)
28+
*
29+
* @param key Key of environment or property value
30+
* @return Environment value or null
31+
*/
32+
publicstaticStringgetEnvValue(Stringkey) {
33+
returngetEnvValue(key,null);
34+
}
35+
36+
/**
37+
* Returns the value for a given key from environment or a default value (see class description)
38+
*
39+
* @param key Key of environment or property value
40+
* @param defaultValue Default value if nothing found
41+
* @return Environment value or defaultValue
42+
*/
43+
publicstaticStringgetEnvValue(Stringkey,@NullableStringdefaultValue) {
44+
45+
Stringval =System.getProperty(key);
46+
if (val ==null ||val.isEmpty())val =System.getenv(key);
47+
if (val ==null ||val.isEmpty())val =defaultValue;
48+
49+
returnval;
50+
}
51+
52+
53+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp