Package org.eclipse.rdf4j.rio.helpers
Class AbstractRioSetting<T>
- java.lang.Object
-
- org.eclipse.rdf4j.rio.helpers.AbstractRioSetting<T>
-
- Type Parameters:
T
- the setting type
- All Implemented Interfaces:
java.io.Serializable
,RioSetting<T>
- Direct Known Subclasses:
BooleanRioSetting
,ClassRioSetting
,LongRioSetting
,RioSettingImpl
,StringRioSetting
public abstract class AbstractRioSetting<T> extends java.lang.Object implements RioSetting<T>
Base class forRioSetting
. Includes base functionality for reading default values from system properties.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private T
defaultValue
The default value for this setting.private java.lang.String
description
A human-readable description for this settingprivate java.lang.String
key
A unique key for this setting.private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRioSetting(java.lang.String key, java.lang.String description, T defaultValue)
Create a new setting object that will be used to reference the given setting.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
T
getDefaultValue()
Returns the default value for this parser setting if it is not set by a user.java.lang.String
getDescription()
The human readable name for this parser settingjava.lang.String
getKey()
A unique key for this parser setting.int
hashCode()
java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.rio.RioSetting
convert
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
key
private final java.lang.String key
A unique key for this setting.
-
description
private final java.lang.String description
A human-readable description for this setting
-
defaultValue
private final T defaultValue
The default value for this setting.
NOTE: This value must be immutable.
-
-
Constructor Detail
-
AbstractRioSetting
protected AbstractRioSetting(java.lang.String key, java.lang.String description, T defaultValue)
Create a new setting object that will be used to reference the given setting.- Parameters:
key
- A unique key to use for this setting.description
- A short human-readable description for this setting.defaultValue
- An immutable value specifying the default for this setting. This can be optionally be overridden by a system property with a name equal to the setting's unique key.
-
-
Method Detail
-
getKey
public java.lang.String getKey()
Description copied from interface:RioSetting
A unique key for this parser setting.- Specified by:
getKey
in interfaceRioSetting<T>
- Returns:
- A unique key identifying this parser setting.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:RioSetting
The human readable name for this parser setting- Specified by:
getDescription
in interfaceRioSetting<T>
- Returns:
- The name for this parser setting.
-
getDefaultValue
public T getDefaultValue()
Description copied from interface:RioSetting
Returns the default value for this parser setting if it is not set by a user.- Specified by:
getDefaultValue
in interfaceRioSetting<T>
- Returns:
- The default value for this parser setting.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-