Package jetbrains.buildServer.serverSide
Class AbstractPropertiesProvider
- java.lang.Object
-
- jetbrains.buildServer.serverSide.AbstractPropertiesProvider
-
- All Implemented Interfaces:
TeamCityPropertiesProvider
- Direct Known Subclasses:
InMemoryPropertiesProvider
,InternalPropertiesProvider
public abstract class AbstractPropertiesProvider extends Object implements TeamCityPropertiesProvider
Common super class for
TeamCityPropertiesProvider
implementations.- Since:
- 2018.1
- Author:
- Andrey Shcheglov <mailto:andrey.shcheglov@jetbrains.com>
-
-
Constructor Summary
Constructors Constructor Description AbstractPropertiesProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getBoolean(String key)
Returns the property value as aboolean
, orfalse
if not set.boolean
getBooleanOrTrue(String key)
Returns the property value as aboolean
, ortrue
if not set.float
getFloat(String key)
Returns the property value as afloat
, or0.0f
if not set.float
getFloat(String key, float defaultValue)
Returns the property value as afloat
.int
getInteger(String key)
Returns the property value as anint
, or0
if not set.int
getInteger(String key, int defaultValue)
Returns the property value as anint
.long
getLong(String key)
Returns the property value as along
, or0L
if not set.long
getLong(String key, long defaultValue)
Returns the property value as along
.String
getProperty(String key)
Returns the property value as aString
, or an empty string if not set.String
getProperty(String key, String defaultValue)
Returns the property value as aString
.String
getPropertyOrNull(String key, String defaultValue)
Returns the property value as aString
, ornull
if not set.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.TeamCityPropertiesProvider
getPropertyOrNull
-
-
-
-
Method Detail
-
getBoolean
public final boolean getBoolean(@NotNull String key)
Returns the property value as a
boolean
, orfalse
if not set.- Specified by:
getBoolean
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.- Returns:
- property value as a
boolean
. - See Also:
TeamCityPropertiesProvider.getBoolean(String)
-
getBooleanOrTrue
public final boolean getBooleanOrTrue(@NotNull String key)
Returns the property value as a
boolean
, ortrue
if not set.- Specified by:
getBooleanOrTrue
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.- Returns:
- property value as a
boolean
. - See Also:
TeamCityPropertiesProvider.getBooleanOrTrue(String)
-
getInteger
public final int getInteger(@NotNull String key)
Returns the property value as an
int
, or0
if not set.- Specified by:
getInteger
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.- Returns:
- property value as an
int
. - See Also:
TeamCityPropertiesProvider.getInteger(String)
-
getInteger
public final int getInteger(@NotNull String key, int defaultValue)
Returns the property value as an
int
.- Specified by:
getInteger
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.defaultValue
- default value.- Returns:
- property value as an
int
. - See Also:
TeamCityPropertiesProvider.getInteger(String, int)
-
getFloat
public final float getFloat(@NotNull String key)
Returns the property value as a
float
, or0.0f
if not set.- Specified by:
getFloat
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.- Returns:
- property value as a
float
. - See Also:
TeamCityPropertiesProvider.getFloat(String)
-
getFloat
public final float getFloat(@NotNull String key, float defaultValue)
Returns the property value as a
float
.- Specified by:
getFloat
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.defaultValue
- default value.- Returns:
- property value as a
float
. - See Also:
TeamCityPropertiesProvider.getFloat(String, float)
-
getLong
public final long getLong(@NotNull String key)
Returns the property value as a
long
, or0L
if not set.- Specified by:
getLong
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.- Returns:
- property value as a
long
. - See Also:
TeamCityPropertiesProvider.getLong(String)
-
getLong
public final long getLong(@NotNull String key, long defaultValue)
Returns the property value as a
long
.- Specified by:
getLong
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.defaultValue
- default value.- Returns:
- property value as a
long
. - See Also:
TeamCityPropertiesProvider.getLong(String, long)
-
getProperty
@NotNull public final String getProperty(@NotNull String key)
Returns the property value as a
String
, or an empty string if not set.- Specified by:
getProperty
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.- Returns:
- property value as a
String
. - See Also:
TeamCityPropertiesProvider.getProperty(String)
-
getProperty
@NotNull public final String getProperty(@NotNull String key, @NotNull String defaultValue)
Returns the property value as a
String
.- Specified by:
getProperty
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.defaultValue
- default value.- Returns:
- property value as a
String
. - See Also:
TeamCityPropertiesProvider.getProperty(String, String)
-
getPropertyOrNull
@Nullable @Contract("_, !null -> !null") public final String getPropertyOrNull(@NotNull String key, @Nullable String defaultValue)
Returns the property value as a
String
, ornull
if not set.- Specified by:
getPropertyOrNull
in interfaceTeamCityPropertiesProvider
- Parameters:
key
- the property key.defaultValue
- default value.- Returns:
- property value as a
String
. - See Also:
TeamCityPropertiesProvider.getPropertyOrNull(String, String)
-
-