Package ghidra.program.model.data
Class SettingsBuilder
- java.lang.Object
-
- ghidra.program.model.data.SettingsBuilder
-
-
Constructor Summary
Constructors Constructor Description SettingsBuilder()
Creates an empty settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAllSettings()
Removes all name-value pairs from this settings objectvoid
clearSetting(java.lang.String name)
Removes any value associated with the given namebyte[]
getByteArray(java.lang.String name)
Gets the byte[] value associated with the given nameSettings
getDefaultSettings()
Returns the underlying default settings for these settings or null if there are nonejava.lang.Long
getLong(java.lang.String name)
Gets the Long value associated with the given namejava.lang.String[]
getNames()
Get this list of keys that currently have values associated with themjava.lang.String
getString(java.lang.String name)
Gets the String value associated with the given namejava.lang.Object
getValue(java.lang.String name)
Gets the object associated with the given nameboolean
isEmpty()
Returns true if there are no key-value pairs stored in this settings objectSettingsBuilder
set(RenderUnicodeSettingsDefinition.RENDER_ENUM ruenum)
Sets theRenderUnicodeSettingsDefinition
setting.SettingsBuilder
set(TranslationSettingsDefinition.TRANSLATION_ENUM tenum)
Sets theTranslationSettingsDefinition
setting.SettingsBuilder
set(java.nio.charset.Charset cs)
Sets theCharsetSettingsDefinition
.void
setByteArray(java.lang.String name, byte[] value)
Associates the given byte[] with the namevoid
setLong(java.lang.String name, long value)
Associates the given long value with the namevoid
setString(java.lang.String name, java.lang.String value)
Associates the given String value with the namevoid
setValue(java.lang.String name, java.lang.Object value)
Associates the given object with the name
-
-
-
Method Detail
-
set
public SettingsBuilder set(java.nio.charset.Charset cs)
Sets theCharsetSettingsDefinition
.- Parameters:
cs
- Charset to set- Returns:
- chainable SettingsBuilder
-
set
public SettingsBuilder set(RenderUnicodeSettingsDefinition.RENDER_ENUM ruenum)
Sets theRenderUnicodeSettingsDefinition
setting.- Parameters:
ruenum
-RenderUnicodeSettingsDefinition.RENDER_ENUM
value to set.- Returns:
- chainable SettingsBuilder
-
set
public SettingsBuilder set(TranslationSettingsDefinition.TRANSLATION_ENUM tenum)
Sets theTranslationSettingsDefinition
setting.- Parameters:
tenum
-TranslationSettingsDefinition.TRANSLATION_ENUM
value to set.- Returns:
- chainable SettingsBuilder
-
getLong
public java.lang.Long getLong(java.lang.String name)
Description copied from interface:Settings
Gets the Long value associated with the given name
-
getString
public java.lang.String getString(java.lang.String name)
Description copied from interface:Settings
Gets the String value associated with the given name
-
getByteArray
public byte[] getByteArray(java.lang.String name)
Description copied from interface:Settings
Gets the byte[] value associated with the given name- Specified by:
getByteArray
in interfaceSettings
- Parameters:
name
- the key used to retrieve a value- Returns:
- the byte[] value for a key
-
getValue
public java.lang.Object getValue(java.lang.String name)
Description copied from interface:Settings
Gets the object associated with the given name
-
setLong
public void setLong(java.lang.String name, long value)
Description copied from interface:Settings
Associates the given long value with the name
-
setString
public void setString(java.lang.String name, java.lang.String value)
Description copied from interface:Settings
Associates the given String value with the name
-
setByteArray
public void setByteArray(java.lang.String name, byte[] value)
Description copied from interface:Settings
Associates the given byte[] with the name- Specified by:
setByteArray
in interfaceSettings
- Parameters:
name
- the keyvalue
- the value associated with the key
-
setValue
public void setValue(java.lang.String name, java.lang.Object value)
Description copied from interface:Settings
Associates the given object with the name
-
clearSetting
public void clearSetting(java.lang.String name)
Description copied from interface:Settings
Removes any value associated with the given name- Specified by:
clearSetting
in interfaceSettings
- Parameters:
name
- the key to remove any association
-
clearAllSettings
public void clearAllSettings()
Description copied from interface:Settings
Removes all name-value pairs from this settings object- Specified by:
clearAllSettings
in interfaceSettings
-
getNames
public java.lang.String[] getNames()
Description copied from interface:Settings
Get this list of keys that currently have values associated with them
-
isEmpty
public boolean isEmpty()
Description copied from interface:Settings
Returns true if there are no key-value pairs stored in this settings object
-
getDefaultSettings
public Settings getDefaultSettings()
Description copied from interface:Settings
Returns the underlying default settings for these settings or null if there are none- Specified by:
getDefaultSettings
in interfaceSettings
-
-