Skip to content

Commit

Permalink
Testing for existing custom TestSet tests field ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Reiche committed Jan 26, 2022
1 parent 4db2b23 commit 165bd3a
Showing 1 changed file with 55 additions and 0 deletions.
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();
}

0 comments on commit 165bd3a

Please sign in to comment.