Package ome.formats.importer
Class ImportConfig.Value<T>
- java.lang.Object
-
- ome.formats.importer.ImportConfig.Value<T>
-
- Type Parameters:
T
- the kind of value to associate with the key
- Direct Known Subclasses:
ImportConfig.AnnotationListValue
,ImportConfig.BoolValue
,ImportConfig.DoubleArrayValue
,ImportConfig.FileValue
,ImportConfig.IntValue
,ImportConfig.LongValue
,ImportConfig.StrValue
- Enclosing class:
- ImportConfig
public abstract static class ImportConfig.Value<T> extends java.lang.Object
Container which thread-safely makes a generic configuration value available, without requiring getters and setters.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
empty()
protected abstract T
fromString(java.lang.String string)
T
get()
Returns the generic type contained by this holder.void
load()
Loads properties from various locations.void
set(T t)
Sets the in-memory value, which will get persisted onstore()
whenImportConfig.saveAll()
is called.void
store()
Stores the current value back to some medium.java.lang.String
toString()
-
-
-
Method Detail
-
get
public T get()
Returns the generic type contained by this holder. This does not touch the persistent stores, but only accesses the value in-memory.- Returns:
- the held value
-
set
public void set(T t)
Sets the in-memory value, which will get persisted onstore()
whenImportConfig.saveAll()
is called.- Parameters:
t
- the value to hold
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
store
public void store()
Stores the current value back to some medium. In each case, the type-matching source is used except when theProperties
are used, since this is most likely not a persistent store.
-
load
public void load()
Loads properties from various locations. In order, theProperties
argument, thePreferenceContext
, thePreferences
, theIniFileLoader
, and finally the default value.
-
empty
public boolean empty()
-
fromString
protected abstract T fromString(java.lang.String string)
-
-