Package jetbrains.buildServer.util
Class Option<Type>
- java.lang.Object
-
- jetbrains.buildServer.util.Option<Type>
-
- Type Parameters:
Type
- type of the option
- Direct Known Subclasses:
BooleanOption
,EnumOption
,IntegerOption
,StringOption
public abstract class Option<Type> extends Object
Represents a named option of given Type and some default value.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static Option
fromKey(String key)
Find option with given key in the registry of optionsabstract Type
fromString(String value)
Option values are serialized to strings using toString() call.Type
getDefaultValue()
String
getKey()
int
hashCode()
String
toString()
abstract String
toString(Type value)
Serialize option value to string
-
-
-
Method Detail
-
fromString
public abstract Type fromString(@NotNull String value)
Option values are serialized to strings using toString() call. To restore option value from string this method is used- Parameters:
value
- serialized option valueObject.toString()
method is used for serialization)- Returns:
- deserialized value
-
toString
public abstract String toString(Type value)
Serialize option value to string- Parameters:
value
- value to serialize- Returns:
- serialized option value
-
fromKey
@Nullable public static Option fromKey(String key)
Find option with given key in the registry of options- Parameters:
key
- option key, seegetKey()
- Returns:
- option for this key
-
getKey
@NotNull public String getKey()
- Returns:
- key of the option (non-displayable)
-
getDefaultValue
@NotNull public Type getDefaultValue()
- Returns:
- default value of the option
-
-