forked from telekom/testerra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing for existing custom TestSet tests field ID
- Loading branch information
Mike Reiche
committed
Jan 26, 2022
1 parent
4db2b23
commit 165bd3a
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
core/src/main/java/eu/tsystems/mms/tic/testframework/common/IProperties.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,55 @@ | ||
/* | ||
* Testerra | ||
* | ||
* (C) 2020, Mike Reiche, T-Systems Multimedia Solutions GmbH, Deutsche Telekom AG | ||
* | ||
* Deutsche Telekom AG and all other contributors / | ||
* copyright owners license this file to you under the Apache | ||
* License, Version 2.0 (the "License"); you may not use this | ||
* file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package eu.tsystems.mms.tic.testframework.common; | ||
|
||
/** | ||
* New Properties with overridable default value | ||
* @author Mike Reiche | ||
*/ | ||
public interface IProperties { | ||
/** | ||
* Gets the default value | ||
*/ | ||
Object getDefault(); | ||
/** | ||
* @return Value as double | ||
*/ | ||
default Double asDouble() { | ||
return PropertyManager.getDoubleProperty(toString(),Double.parseDouble(getDefault().toString())); | ||
} | ||
/** | ||
* @return Value as long | ||
*/ | ||
default Long asLong() { return PropertyManager.getLongProperty(toString(), Long.parseLong(getDefault().toString())); } | ||
/** | ||
* @return Value as boolean | ||
*/ | ||
default Boolean asBool() { return PropertyManager.getBooleanProperty(toString(), Boolean.parseBoolean(getDefault().toString())); } | ||
/** | ||
* @return Value as string | ||
*/ | ||
default String asString() { return PropertyManager.getProperty(toString(), getDefault().toString()); } | ||
/** | ||
* @return Property string | ||
*/ | ||
String toString(); | ||
} |